﻿namespace ACCOUNTING
{
    using ACCOUNTING.LVY.Business;
    using ACCOUNTING.My;
    using ACCOUNTING.My.Resources;
    using C1.Win.C1FlexGrid;
    using C1.Win.C1FlexGrid.Util.BaseControls;
    using C1.Win.C1Input;
    using Microsoft.VisualBasic;
    using Microsoft.VisualBasic.CompilerServices;
    using System;
    using System.Collections.Generic;
    using System.ComponentModel;
    using System.Data;
    using System.Diagnostics;
    using System.Drawing;
    using System.Runtime.CompilerServices;
    using System.Windows.Forms;

    [DesignerGenerated]
    public class Frm_YeuCauBaoGia : Form
    {
        private static List<WeakReference> __ENCList = new List<WeakReference>();
        [AccessedThroughProperty("AdvNhaCungCap")]
        private ADVObjects _AdvNhaCungCap;
        [AccessedThroughProperty("AdvNhanVien")]
        private ADVObjects _AdvNhanVien;
        [AccessedThroughProperty("CboLanguage")]
        private ToolStripComboBox _CboLanguage;
        [AccessedThroughProperty("CboLienHe")]
        private ComboBox _CboLienHe;
        [AccessedThroughProperty("CboLoaiTien")]
        private ComboBox _CboLoaiTien;
        [AccessedThroughProperty("CboPhuongThucThanhToan")]
        private ComboBox _CboPhuongThucThanhToan;
        [AccessedThroughProperty("CboPhuongThucVanChuyen")]
        private ComboBox _CboPhuongThucVanChuyen;
        [AccessedThroughProperty("CboTinhTrang")]
        private ComboBox _CboTinhTrang;
        [AccessedThroughProperty("CmdAdd")]
        private ToolStripButton _CmdAdd;
        [AccessedThroughProperty("CmdAddRow")]
        private Button _CmdAddRow;
        [AccessedThroughProperty("CmdDel")]
        private ToolStripButton _CmdDel;
        [AccessedThroughProperty("CmdDelRow")]
        private Button _CmdDelRow;
        [AccessedThroughProperty("CmdEdit")]
        private ToolStripButton _CmdEdit;
        [AccessedThroughProperty("CmdExit")]
        private ToolStripButton _CmdExit;
        [AccessedThroughProperty("CmdFind")]
        private ToolStripButton _CmdFind;
        [AccessedThroughProperty("CmdHelp")]
        private ToolStripButton _CmdHelp;
        [AccessedThroughProperty("CmdInTiengAnh")]
        private ToolStripMenuItem _CmdInTiengAnh;
        [AccessedThroughProperty("CmdInTiengViet")]
        private ToolStripMenuItem _CmdInTiengViet;
        [AccessedThroughProperty("CmdPrint")]
        private ToolStripDropDownButton _CmdPrint;
        [AccessedThroughProperty("CmdSave")]
        private ToolStripButton _CmdSave;
        [AccessedThroughProperty("CmdUnsave")]
        private ToolStripButton _CmdUnsave;
        [AccessedThroughProperty("CmdXacNhan")]
        private ToolStripButton _CmdXacNhan;
        [AccessedThroughProperty("Label1")]
        private Label _Label1;
        [AccessedThroughProperty("Label10")]
        private Label _Label10;
        [AccessedThroughProperty("Label11")]
        private Label _Label11;
        [AccessedThroughProperty("Label12")]
        private Label _Label12;
        [AccessedThroughProperty("Label13")]
        private Label _Label13;
        [AccessedThroughProperty("Label14")]
        private Label _Label14;
        [AccessedThroughProperty("Label15")]
        private Label _Label15;
        [AccessedThroughProperty("Label16")]
        private Label _Label16;
        [AccessedThroughProperty("Label17")]
        private Label _Label17;
        [AccessedThroughProperty("Label18")]
        private Label _Label18;
        [AccessedThroughProperty("Label19")]
        private Label _Label19;
        [AccessedThroughProperty("Label2")]
        private Label _Label2;
        [AccessedThroughProperty("Label3")]
        private Label _Label3;
        [AccessedThroughProperty("Label4")]
        private Label _Label4;
        [AccessedThroughProperty("Label5")]
        private Label _Label5;
        [AccessedThroughProperty("Label6")]
        private Label _Label6;
        [AccessedThroughProperty("Label7")]
        private Label _Label7;
        [AccessedThroughProperty("Label8")]
        private Label _Label8;
        [AccessedThroughProperty("Label9")]
        private Label _Label9;
        [AccessedThroughProperty("Panel4")]
        private Panel _Panel4;
        [AccessedThroughProperty("Panel5")]
        private Panel _Panel5;
        [AccessedThroughProperty("TabControl1")]
        private TabControl _TabControl1;
        [AccessedThroughProperty("TabDetails")]
        private TabControl _TabDetails;
        [AccessedThroughProperty("TabPage1")]
        private TabPage _TabPage1;
        [AccessedThroughProperty("TabPage4")]
        private TabPage _TabPage4;
        [AccessedThroughProperty("ToolStrip1")]
        private ToolStrip _ToolStrip1;
        [AccessedThroughProperty("ToolStripButton1")]
        private ToolStripSeparator _ToolStripButton1;
        [AccessedThroughProperty("ToolStripSeparator1")]
        private ToolStripSeparator _ToolStripSeparator1;
        [AccessedThroughProperty("ToolStripSeparator2")]
        private ToolStripSeparator _ToolStripSeparator2;
        [AccessedThroughProperty("ToolStripSeparator3")]
        private ToolStripSeparator _ToolStripSeparator3;
        [AccessedThroughProperty("TxtCongThem")]
        private C1NumericEdit _TxtCongThem;
        [AccessedThroughProperty("TxtCongThemNT")]
        private C1NumericEdit _TxtCongThemNT;
        [AccessedThroughProperty("TxtDiaChiGiaoHang")]
        private TextBox _TxtDiaChiGiaoHang;
        [AccessedThroughProperty("TxtDiaChiNhaCungCap")]
        private TextBox _TxtDiaChiNhaCungCap;
        [AccessedThroughProperty("TxtDienGiai")]
        private TextBox _TxtDienGiai;
        [AccessedThroughProperty("TxtHanGiaoHang")]
        private DateTimePicker _TxtHanGiaoHang;
        [AccessedThroughProperty("TxtNgayChungTu")]
        private DateTimePicker _TxtNgayChungTu;
        [AccessedThroughProperty("TxtSoChungTu")]
        private TextBox _TxtSoChungTu;
        [AccessedThroughProperty("TxtSoHopDong")]
        private TextBox _TxtSoHopDong;
        [AccessedThroughProperty("TxtSoTien")]
        private C1NumericEdit _TxtSoTien;
        [AccessedThroughProperty("TxtSoTienNT")]
        private C1NumericEdit _TxtSoTienNT;
        [AccessedThroughProperty("TxtTienThue")]
        private C1NumericEdit _TxtTienThue;
        [AccessedThroughProperty("TxtTienThueNT")]
        private C1NumericEdit _TxtTienThueNT;
        [AccessedThroughProperty("TxtTongCong")]
        private C1NumericEdit _TxtTongCong;
        [AccessedThroughProperty("TxtTongCongNT")]
        private C1NumericEdit _TxtTongCongNT;
        [AccessedThroughProperty("txtTyGia")]
        private C1NumericEdit _txtTyGia;
        [AccessedThroughProperty("VSlist")]
        private C1.Win.C1FlexGrid.C1FlexGrid _VSlist;
        private string cFrmFormat;
        public string cFrmKhoa;
        private string cFrmKhoaOld;
        private string cFrmLanguage;
        private const string cFrmLoai = "PO";
        private IContainer components;
        private bool mAllowAdd;
        private bool mAllowDel;
        private bool mAllowEdit;
        private bool mAllowView;
        private bool mEnabledControl;
        private string mLoaiChungTu;
        private clsDonDatHang objDH;
        private clsDonDatHangChiTiet objDHCT;
        private clsSoChungTu objSoCT;

        public Frm_YeuCauBaoGia()
        {
            base.KeyDown += new KeyEventHandler(this.Frm_DonDatHangMua_KeyDown);
            base.Load += new EventHandler(this.Frm_DonDatHangMua_Load);
            List<WeakReference> list = __ENCList;
            lock (list)
            {
                __ENCList.Add(new WeakReference(this));
            }
            this.mLoaiChungTu = "YCBG";
            this.objSoCT = new clsSoChungTu();
            this.cFrmKhoa = "";
            this.cFrmKhoaOld = "";
            this.objDH = new clsDonDatHang();
            this.objDHCT = new clsDonDatHangChiTiet();
            this.InitializeComponent();
        }

        private void AdvNhaCungCap_ValueChanged(object sender, EventArgs e)
        {
            if (this.AdvNhaCungCap.Value.Trim() == "")
            {
                this.CboLienHe.Text = "";
                this.CboLienHe.SelectedValue = "";
                this.CboLienHe.DataSource = null;
                this.TxtDiaChiNhaCungCap.Text = "";
            }
            else
            {
                clsDMDoiTuong tuong = new clsDMDoiTuong();
                tuong.Load(this.AdvNhaCungCap.Value);
                this.CboLienHe.DataSource = tuong.GetContactor(tuong.Khoa);
                this.CboLienHe.ValueMember = "Khoa";
                this.CboLienHe.DisplayMember = "Ten";
                if (this.CboLienHe.Items.Count >= 1)
                {
                    this.CboLienHe.SelectedIndex = 0;
                }
                this.TxtDiaChiNhaCungCap.Text = tuong.DiaChi.Trim();
            }
        }

        private void CboLoaiTien_SelectedIndexChanged(object sender, EventArgs e)
        {
            if (LVYModule.ReturnIfNull(RuntimeHelpers.GetObjectValue(this.CboLoaiTien.SelectedValue), "", modGeneral.TypeOfValue.String).ToString().Trim() == "")
            {
                this.txtTyGia.Value = 0;
            }
            else
            {
                string strCode = LVYModule.ReturnIfNull(RuntimeHelpers.GetObjectValue(this.CboLoaiTien.SelectedValue), "", modGeneral.TypeOfValue.String).ToString().Trim();
                if (strCode != "")
                {
                    clsDMLoaiTien tien = new clsDMLoaiTien();
                    tien.LoadByCode(strCode);
                    if (tien.SoLe > 0)
                    {
                        this.cFrmFormat = modGeneral.H_FORMATNUMBER + "." + LVYModule.sRight("000000000", tien.SoLe);
                    }
                    if (tien.TienViet == 1)
                    {
                        this.txtTyGia.Enabled = false;
                    }
                    else
                    {
                        this.txtTyGia.Enabled = true;
                    }
                    this.txtTyGia.Value = tien.TyGia;
                    this.FormatNumber();
                }
            }
        }

        public bool CheckIvalid()
        {
            if (this.TxtSoChungTu.Text.Trim() == "")
            {
                LVYModule.ShowWarning(modGeneral.Tranlated("Bạn phải nhập số chứng từ", ""));
                this.TxtSoChungTu.Focus();
                return false;
            }
            if (this.objDH.IsDuplicateVoucherNo(this.TxtSoChungTu.Text.Trim(), this.cFrmKhoa, "PO"))
            {
                LVYModule.ShowWarning(modGeneral.Tranlated("Số chứng từ bị tr\x00f9ng!", ""));
                this.TxtSoChungTu.Focus();
                return false;
            }
            if (this.AdvNhaCungCap.Value.Trim() == "")
            {
                LVYModule.ShowWarning(modGeneral.Tranlated("Bạn phải nhập nh\x00e0 cung cấp!", ""));
                this.AdvNhaCungCap.Focus();
                return false;
            }
            if (this.TxtDiaChiGiaoHang.Text.Trim() == "")
            {
                LVYModule.ShowWarning(modGeneral.Tranlated("Bạn phải nhập địa chỉ giao h\x00e0ng!", ""));
                this.TxtDiaChiGiaoHang.Focus();
                return false;
            }
            if (this.objDH.TrungSoChungTu(this.TxtSoChungTu.Text.Trim(), this.cFrmKhoa))
            {
                LVYModule.ShowWarning(modGeneral.Tranlated("Số chứng từ n\x00e0y đ\x00e3 tồn tại, bạn phải nhập số chứng từ kh\x00e1c!", ""));
                this.TxtSoChungTu.Focus();
                return false;
            }
            if (Microsoft.VisualBasic.CompilerServices.Operators.CompareString(LVYModule.Date2Char(this.TxtHanGiaoHang.Text), LVYModule.Date2Char(this.TxtNgayChungTu.Text), false) < 0)
            {
                LVYModule.ShowWarning(modGeneral.Tranlated("Ng\x00e0y giao h\x00e0ng phải sau ng\x00e0y đặt h\x00e0ng!", ""));
                this.TxtHanGiaoHang.Focus();
                return false;
            }
            if (this.CboTinhTrang.Text.Trim() == "")
            {
                LVYModule.ShowWarning(modGeneral.Tranlated("Bạn phải chọn t\x00ecnh trạng của h\x00f3a đơn!", ""));
                this.CboTinhTrang.Focus();
                return false;
            }
            if (this.VSlist.Rows.Count == 1)
            {
                LVYModule.ShowWarning(modGeneral.Tranlated("Bạn phải nhập h\x00e0ng h\x00f3a đặt mua!", ""));
                this.CmdAddRow.Focus();
                return false;
            }
            return true;
        }

        private void CmdAdd_Click(object sender, EventArgs e)
        {
            if (this.cFrmKhoa.Trim() != "")
            {
                this.cFrmKhoaOld = this.cFrmKhoa;
            }
            this.EmptyData();
            this.cFrmKhoa = modGeneral.CreatKey("BH_PhaiTra", 15, "PO");
            this.objSoCT.Load(this.mLoaiChungTu);
            this.TxtSoChungTu.Text = this.objSoCT.CreateVoucher(LVYModule.sLeft(LVYModule.Date2Char(this.TxtNgayChungTu.Text), 6), 1);
            this.TxtDiaChiGiaoHang.Text = modGeneral.H_DCGIAOHANG;
            this.EnabledControl = true;
            this.TxtSoChungTu.Focus();
        }

        private void CmdAddRow_Click(object sender, EventArgs e)
        {
            if (this.AdvNhaCungCap.Value.Trim() == "")
            {
                LVYModule.ShowWarning(modGeneral.Tranlated("Bạn phải nhập nh\x00e0 cung cấp!", ""));
                this.AdvNhaCungCap.Focus();
            }
            else if (LVYModule.ReturnIfNull(RuntimeHelpers.GetObjectValue(this.CboLoaiTien.SelectedValue), "", modGeneral.TypeOfValue.String).ToString().Trim() == "")
            {
                LVYModule.ShowWarning(modGeneral.Tranlated("Bạn phải nhập loại tiền!", ""));
                this.AdvNhaCungCap.Focus();
            }
            else if ((this.VSlist.Rows.Count <= 1) || (LVYModule.ReturnIfNull(RuntimeHelpers.GetObjectValue(this.VSlist[this.VSlist.Rows.Count - 1, 1]), "", modGeneral.TypeOfValue.Nothing).ToString().Trim() != ""))
            {
                this.VSlist.AddItem("");
                this.VSlist.Select(this.VSlist.Rows.Count - 1, 2);
                this.VSlist.Focus();
            }
        }

        private void CmdDel_Click(object sender, EventArgs e)
        {
            if (this.objDH.TinhTrang != "OP")
            {
                LVYModule.ShowWarning(modGeneral.Tranlated("Đơn h\x00e0ng đ\x00e3 được xử l\x00fd n\x00ean bạn kh\x00f4ng thể x\x00f3a!", ""));
            }
            else if (LVYModule.ConfirmDelete("") && this.objDH.DeleteData(this.cFrmKhoa))
            {
                this.EmptyData();
            }
        }

        private void CmdDelRow_Click(object sender, EventArgs e)
        {
            if ((this.VSlist.Rows.Count != 1) && (this.VSlist.Row > 0))
            {
                this.VSlist.RemoveItem(this.VSlist.Row);
            }
        }

        private void CmdEdit_Click(object sender, EventArgs e)
        {
            if (LVYModule.ReturnIfNull(this.cFrmKhoa, "", modGeneral.TypeOfValue.Nothing).ToString().Trim() != "")
            {
                if (this.objDH.TinhTrang != "OP")
                {
                    LVYModule.ShowWarning(modGeneral.Tranlated("Đơn h\x00e0ng đ\x00e3 được xử l\x00fd n\x00ean bạn kh\x00f4ng thể chỉnh sửa!", ""));
                }
                else
                {
                    this.EnabledControl = true;
                }
            }
        }

        private void CmdExit_Click(object sender, EventArgs e)
        {
            this.Dispose();
        }

        private void CmdFind_Click(object sender, EventArgs e)
        {
            MyProject.Forms.Frm_DonDatHangMuaList.Dispose();
            MyProject.Forms.Frm_DonDatHangMuaList.ShowDialog();
        }

        private void CmdInTiengAnh_Click(object sender, EventArgs e)
        {
            if (this.cFrmKhoa.ToString().Trim() != "")
            {
                ReportModule.PrintPurchaseOrder(this.cFrmKhoa, "ANH");
            }
        }

        private void CmdInTiengViet_Click(object sender, EventArgs e)
        {
            if (this.cFrmKhoa.ToString().Trim() != "")
            {
                ReportModule.PrintPurchaseOrder(this.cFrmKhoa, "VIET");
            }
        }

        private void CmdPrint_Click(object sender, EventArgs e)
        {
        }

        private void CmdSave_Click(object sender, EventArgs e)
        {
            if (this.CheckIvalid())
            {
                if (!this.SaveTemp())
                {
                    this.objDH.ClearTemp(this.cFrmKhoa);
                }
                else if (!this.UpdateData())
                {
                    this.objDH.ClearTemp(this.cFrmKhoa);
                }
                else
                {
                    this.objDH.ClearTemp(this.cFrmKhoa);
                    this.EnabledControl = false;
                }
            }
        }

        private void CmdUnsave_Click(object sender, EventArgs e)
        {
            this.EnabledControl = false;
        }

        private void CmdXacNhan_Click(object sender, EventArgs e)
        {
            if (LVYModule.ReturnIfNull(this.cFrmKhoa, "", modGeneral.TypeOfValue.Nothing).ToString().Trim() != "")
            {
                MyProject.Forms.Frm_XacNhanDonHang.cFrmKhoaDonHang = this.cFrmKhoa;
                MyProject.Forms.Frm_XacNhanDonHang.ShowDialog();
                this.ShowData(this.cFrmKhoa);
            }
        }

        [DebuggerNonUserCode]
        protected override void Dispose(bool disposing)
        {
            if (disposing && (this.components != null))
            {
                this.components.Dispose();
            }
            base.Dispose(disposing);
        }

        public void EmptyData()
        {
        }

        public void FormatNumber()
        {
            LVYModule.advFormatNumber(this.txtTyGia, this.cFrmFormat);
            LVYModule.advFormatNumber(this.TxtSoTienNT, this.cFrmFormat);
            LVYModule.advFormatNumber(this.TxtSoTien, modGeneral.H_FORMATNUMBER);
            LVYModule.advFormatNumber(this.TxtCongThemNT, this.cFrmFormat);
            LVYModule.advFormatNumber(this.TxtCongThem, modGeneral.H_FORMATNUMBER);
            LVYModule.advFormatNumber(this.TxtTongCongNT, this.cFrmFormat);
            LVYModule.advFormatNumber(this.TxtTongCong, modGeneral.H_FORMATNUMBER);
            LVYModule.advFormatNumber(this.TxtTienThueNT, this.cFrmFormat);
            LVYModule.advFormatNumber(this.TxtTienThue, modGeneral.H_FORMATNUMBER);
        }

        private void Frm_DonDatHangMua_KeyDown(object sender, KeyEventArgs e)
        {
            Keys keyCode = e.KeyCode;
            if (keyCode != Keys.ControlKey)
            {
                if (keyCode == Keys.Escape)
                {
                    if (this.CmdExit.Enabled)
                    {
                        this.CmdExit_Click(RuntimeHelpers.GetObjectValue(sender), e);
                    }
                }
                else if (keyCode == Keys.F2)
                {
                    if (this.CmdEdit.Enabled)
                    {
                        this.CmdEdit_Click(RuntimeHelpers.GetObjectValue(sender), e);
                    }
                }
                else if (keyCode == Keys.F3)
                {
                    this.CmdFind_Click(RuntimeHelpers.GetObjectValue(sender), e);
                }
                else if (keyCode == Keys.F8)
                {
                    if (this.CmdAdd.Enabled)
                    {
                        this.CmdAdd_Click(RuntimeHelpers.GetObjectValue(sender), e);
                    }
                }
                else if (keyCode == Keys.F9)
                {
                    if (this.CmdDel.Enabled)
                    {
                        this.CmdDel_Click(RuntimeHelpers.GetObjectValue(sender), e);
                    }
                }
                else if (keyCode == Keys.F10)
                {
                    if (this.CmdSave.Enabled)
                    {
                        this.CmdSave_Click(RuntimeHelpers.GetObjectValue(sender), e);
                    }
                }
                else if (keyCode == Keys.F11)
                {
                    if (this.CmdUnsave.Enabled)
                    {
                        this.CmdUnsave_Click(RuntimeHelpers.GetObjectValue(sender), e);
                    }
                }
                else if ((keyCode == Keys.F12) && this.CmdPrint.Enabled)
                {
                    this.CmdPrint_Click(RuntimeHelpers.GetObjectValue(sender), e);
                }
            }
        }

        private void Frm_DonDatHangMua_Load(object sender, EventArgs e)
        {
            LVYModule.GetUserRight(ref this.mAllowView, ref this.mAllowDel, ref this.mAllowEdit, ref this.mAllowAdd, Conversions.ToString(this.Tag), modGeneral.H_USERNAME);
            if (!this.mAllowView)
            {
                LVYModule.ShowWarning(modGeneral.Tranlated("Bạn kh\x00f4ng c\x00f3 quyền xem, li\x00ean hệ với người quản trị để biết th\x00eam chi tiết.", ""));
                this.Dispose();
            }
            else
            {
                this.EnabledControl = false;
                this.InitCombo();
                this.cFrmFormat = modGeneral.H_FORMATNUMBER;
                if (LVYModule.ReturnIfNull(this.cFrmKhoa, "", modGeneral.TypeOfValue.Nothing).ToString().Trim() != "")
                {
                    this.ShowData(this.cFrmKhoa);
                }
            }
        }

        private void Frm_KeyDown(object sender, KeyEventArgs e)
        {
            if (e.KeyCode == Keys.Return)
            {
                SendKeys.Send("{TAB}");
            }
        }

        public void InitCombo()
        {
            BuildComboModule.BuildCombo(this.CboLoaiTien, modGeneral.ListDanhMuc.LoaiTien, false, "", "");
            this.CboLanguage.Items.Add("Tiếng Việt");
            this.CboLanguage.Items.Add("English");
            BuildComboModule.BuildCombo(this.CboPhuongThucThanhToan, modGeneral.ListDanhMuc.PhuongThucThanhToan, false, "", "");
            BuildComboModule.BuildCombo(this.CboPhuongThucVanChuyen, modGeneral.ListDanhMuc.PhuongThucVanChuyen, false, "", "");
            this.CboTinhTrang.Items.Clear();
            this.CboTinhTrang.DataSource = modGeneral.H_DUNGCHUNG.ShowList("0000000001");
            this.CboTinhTrang.ValueMember = "Ma";
            this.CboTinhTrang.DisplayMember = "Ten";
        }

        [DebuggerStepThrough]
        private void InitializeComponent()
        {
            ComponentResourceManager manager = new ComponentResourceManager(typeof(Frm_YeuCauBaoGia));
            this.CboTinhTrang = new ComboBox();
            this.Label19 = new Label();
            this.CmdDelRow = new Button();
            this.TabDetails = new TabControl();
            this.TabPage4 = new TabPage();
            this.VSlist = new C1.Win.C1FlexGrid.C1FlexGrid();
            this.TxtSoTien = new C1NumericEdit();
            this.Panel4 = new Panel();
            this.CmdAddRow = new Button();
            this.Panel5 = new Panel();
            this.TxtTienThue = new C1NumericEdit();
            this.TxtTienThueNT = new C1NumericEdit();
            this.Label15 = new Label();
            this.TxtTongCong = new C1NumericEdit();
            this.TxtTongCongNT = new C1NumericEdit();
            this.Label14 = new Label();
            this.TxtCongThem = new C1NumericEdit();
            this.TxtCongThemNT = new C1NumericEdit();
            this.Label12 = new Label();
            this.TxtSoTienNT = new C1NumericEdit();
            this.Label5 = new Label();
            this.TxtDiaChiNhaCungCap = new TextBox();
            this.CmdHelp = new ToolStripButton();
            this.CmdExit = new ToolStripButton();
            this.CboLanguage = new ToolStripComboBox();
            this.CmdXacNhan = new ToolStripButton();
            this.AdvNhaCungCap = new ADVObjects();
            this.Label17 = new Label();
            this.AdvNhanVien = new ADVObjects();
            this.Label18 = new Label();
            this.TxtSoHopDong = new TextBox();
            this.CboLienHe = new ComboBox();
            this.CboPhuongThucThanhToan = new ComboBox();
            this.Label8 = new Label();
            this.Label7 = new Label();
            this.TxtHanGiaoHang = new DateTimePicker();
            this.TxtDiaChiGiaoHang = new TextBox();
            this.Label6 = new Label();
            this.CboPhuongThucVanChuyen = new ComboBox();
            this.Label4 = new Label();
            this.Label2 = new Label();
            this.Label16 = new Label();
            this.TxtDienGiai = new TextBox();
            this.Label9 = new Label();
            this.ToolStripSeparator2 = new ToolStripSeparator();
            this.TabPage1 = new TabPage();
            this.Label3 = new Label();
            this.CboLoaiTien = new ComboBox();
            this.txtTyGia = new C1NumericEdit();
            this.Label11 = new Label();
            this.Label10 = new Label();
            this.Label13 = new Label();
            this.TxtNgayChungTu = new DateTimePicker();
            this.Label1 = new Label();
            this.TxtSoChungTu = new TextBox();
            this.CmdUnsave = new ToolStripButton();
            this.TabControl1 = new TabControl();
            this.CmdInTiengAnh = new ToolStripMenuItem();
            this.CmdInTiengViet = new ToolStripMenuItem();
            this.CmdPrint = new ToolStripDropDownButton();
            this.ToolStripSeparator3 = new ToolStripSeparator();
            this.CmdDel = new ToolStripButton();
            this.ToolStripButton1 = new ToolStripSeparator();
            this.CmdEdit = new ToolStripButton();
            this.CmdAdd = new ToolStripButton();
            this.ToolStrip1 = new ToolStrip();
            this.CmdSave = new ToolStripButton();
            this.ToolStripSeparator1 = new ToolStripSeparator();
            this.CmdFind = new ToolStripButton();
            this.TabDetails.SuspendLayout();
            this.TabPage4.SuspendLayout();
            this.VSlist.BeginInit();
            ((ISupportInitialize) this.TxtSoTien).BeginInit();
            this.Panel4.SuspendLayout();
            this.Panel5.SuspendLayout();
            ((ISupportInitialize) this.TxtTienThue).BeginInit();
            ((ISupportInitialize) this.TxtTienThueNT).BeginInit();
            ((ISupportInitialize) this.TxtTongCong).BeginInit();
            ((ISupportInitialize) this.TxtTongCongNT).BeginInit();
            ((ISupportInitialize) this.TxtCongThem).BeginInit();
            ((ISupportInitialize) this.TxtCongThemNT).BeginInit();
            ((ISupportInitialize) this.TxtSoTienNT).BeginInit();
            this.TabPage1.SuspendLayout();
            ((ISupportInitialize) this.txtTyGia).BeginInit();
            this.TabControl1.SuspendLayout();
            this.ToolStrip1.SuspendLayout();
            this.SuspendLayout();
            this.CboTinhTrang.FormattingEnabled = true;
            Point point = new Point(0x112, 6);
            this.CboTinhTrang.Location = point;
            this.CboTinhTrang.Name = "CboTinhTrang";
            Size size = new Size(0xc4, 0x15);
            this.CboTinhTrang.Size = size;
            this.CboTinhTrang.TabIndex = 0x26;
            this.Label19.AutoSize = true;
            point = new Point(0xc3, 9);
            this.Label19.Location = point;
            this.Label19.Name = "Label19";
            size = new Size(0x37, 13);
            this.Label19.Size = size;
            this.Label19.TabIndex = 0x25;
            this.Label19.Text = "T\x00ecnh trạng";
            this.CmdDelRow.Image = (Image) manager.GetObject("CmdDelRow.Image");
            this.CmdDelRow.ImageAlign = ContentAlignment.MiddleLeft;
            point = new Point(100, 4);
            this.CmdDelRow.Location = point;
            this.CmdDelRow.Name = "CmdDelRow";
            size = new Size(0x59, 0x18);
            this.CmdDelRow.Size = size;
            this.CmdDelRow.TabIndex = 0x1c;
            this.CmdDelRow.Text = "&2.X\x00f3a d\x00f2ng";
            this.CmdDelRow.TextImageRelation = TextImageRelation.ImageBeforeText;
            this.CmdDelRow.UseVisualStyleBackColor = true;
            this.TabDetails.Controls.Add(this.TabPage4);
            this.TabDetails.Dock = DockStyle.Fill;
            point = new Point(0, 0xce);
            this.TabDetails.Location = point;
            Padding padding = new Padding(3, 3, 0, 3);
            this.TabDetails.Margin = padding;
            this.TabDetails.Name = "TabDetails";
            this.TabDetails.SelectedIndex = 0;
            size = new Size(0x37e, 0x111);
            this.TabDetails.Size = size;
            this.TabDetails.TabIndex = 0x25;
            this.TabPage4.Controls.Add(this.VSlist);
            point = new Point(4, 0x16);
            this.TabPage4.Location = point;
            this.TabPage4.Name = "TabPage4";
            padding = new Padding(3);
            this.TabPage4.Padding = padding;
            size = new Size(0x376, 0xf7);
            this.TabPage4.Size = size;
            this.TabPage4.TabIndex = 2;
            this.TabPage4.Text = "Chi tiết h\x00e0ng h\x00f3a";
            this.TabPage4.UseVisualStyleBackColor = true;
            this.VSlist.BorderStyle = C1.Win.C1FlexGrid.Util.BaseControls.BorderStyleEnum.Light3D;
            this.VSlist.ColumnInfo = manager.GetString("VSlist.ColumnInfo");
            this.VSlist.Dock = DockStyle.Fill;
            this.VSlist.ExtendLastCol = true;
            this.VSlist.KeyActionEnter = KeyActionEnum.MoveAcross;
            point = new Point(3, 3);
            this.VSlist.Location = point;
            this.VSlist.Name = "VSlist";
            this.VSlist.Rows.Count = 1;
            this.VSlist.Rows.DefaultSize = 0x11;
            this.VSlist.Rows.MaxSize = 20;
            this.VSlist.Rows.MinSize = 20;
            size = new Size(880, 0xf1);
            this.VSlist.Size = size;
            this.VSlist.StyleInfo = manager.GetString("VSlist.StyleInfo");
            this.VSlist.TabIndex = 30;
            this.VSlist.VisualStyle = C1.Win.C1FlexGrid.VisualStyle.Office2007Blue;
            this.TxtSoTien.BorderStyle = BorderStyle.FixedSingle;
            this.TxtSoTien.FormatType = FormatTypeEnum.StandardNumber;
            point = new Point(0xc5, 1);
            this.TxtSoTien.Location = point;
            this.TxtSoTien.Name = "TxtSoTien";
            padding = new Padding(1);
            this.TxtSoTien.Padding = padding;
            this.TxtSoTien.ReadOnly = true;
            size = new Size(0x6d, 20);
            this.TxtSoTien.Size = size;
            this.TxtSoTien.TabIndex = 0x21;
            this.TxtSoTien.Tag = null;
            this.TxtSoTien.TextAlign = HorizontalAlignment.Right;
            decimal num = new decimal(new int[] { 0, 0, 0, 0 });
            this.TxtSoTien.Value = num;
            this.TxtSoTien.VisibleButtons = DropDownControlButtonFlags.None;
            this.TxtSoTien.VisualStyle = C1.Win.C1Input.VisualStyle.Office2007Blue;
            this.TxtSoTien.VisualStyleBaseStyle = C1.Win.C1Input.VisualStyle.Office2007Blue;
            this.Panel4.Controls.Add(this.CboTinhTrang);
            this.Panel4.Controls.Add(this.Label19);
            this.Panel4.Controls.Add(this.CmdDelRow);
            this.Panel4.Controls.Add(this.CmdAddRow);
            this.Panel4.Controls.Add(this.Panel5);
            this.Panel4.Dock = DockStyle.Bottom;
            point = new Point(0, 0x1df);
            this.Panel4.Location = point;
            this.Panel4.Name = "Panel4";
            size = new Size(0x37e, 0x59);
            this.Panel4.Size = size;
            this.Panel4.TabIndex = 0x27;
            this.CmdAddRow.Image = (Image) manager.GetObject("CmdAddRow.Image");
            this.CmdAddRow.ImageAlign = ContentAlignment.MiddleLeft;
            point = new Point(3, 4);
            this.CmdAddRow.Location = point;
            this.CmdAddRow.Name = "CmdAddRow";
            size = new Size(0x5c, 0x18);
            this.CmdAddRow.Size = size;
            this.CmdAddRow.TabIndex = 0x1b;
            this.CmdAddRow.Text = "&1.Th\x00eam d\x00f2ng";
            this.CmdAddRow.TextImageRelation = TextImageRelation.ImageBeforeText;
            this.CmdAddRow.UseVisualStyleBackColor = true;
            this.Panel5.Controls.Add(this.TxtTienThue);
            this.Panel5.Controls.Add(this.TxtTienThueNT);
            this.Panel5.Controls.Add(this.Label15);
            this.Panel5.Controls.Add(this.TxtTongCong);
            this.Panel5.Controls.Add(this.TxtTongCongNT);
            this.Panel5.Controls.Add(this.Label14);
            this.Panel5.Controls.Add(this.TxtCongThem);
            this.Panel5.Controls.Add(this.TxtCongThemNT);
            this.Panel5.Controls.Add(this.Label12);
            this.Panel5.Controls.Add(this.TxtSoTien);
            this.Panel5.Controls.Add(this.TxtSoTienNT);
            this.Panel5.Controls.Add(this.Label5);
            this.Panel5.Dock = DockStyle.Right;
            point = new Point(0x247, 0);
            this.Panel5.Location = point;
            this.Panel5.Name = "Panel5";
            size = new Size(0x137, 0x59);
            this.Panel5.Size = size;
            this.Panel5.TabIndex = 0;
            this.TxtTienThue.BorderStyle = BorderStyle.FixedSingle;
            this.TxtTienThue.FormatType = FormatTypeEnum.StandardNumber;
            point = new Point(0xc5, 0x17);
            this.TxtTienThue.Location = point;
            this.TxtTienThue.Name = "TxtTienThue";
            padding = new Padding(1);
            this.TxtTienThue.Padding = padding;
            this.TxtTienThue.ReadOnly = true;
            size = new Size(0x6d, 20);
            this.TxtTienThue.Size = size;
            this.TxtTienThue.TabIndex = 0x24;
            this.TxtTienThue.Tag = null;
            this.TxtTienThue.TextAlign = HorizontalAlignment.Right;
            num = new decimal(new int[] { 0, 0, 0, 0 });
            this.TxtTienThue.Value = num;
            this.TxtTienThue.VisibleButtons = DropDownControlButtonFlags.None;
            this.TxtTienThue.VisualStyle = C1.Win.C1Input.VisualStyle.Office2007Blue;
            this.TxtTienThue.VisualStyleBaseStyle = C1.Win.C1Input.VisualStyle.Office2007Blue;
            this.TxtTienThueNT.BorderStyle = BorderStyle.FixedSingle;
            this.TxtTienThueNT.FormatType = FormatTypeEnum.StandardNumber;
            point = new Point(0x57, 0x17);
            this.TxtTienThueNT.Location = point;
            this.TxtTienThueNT.Name = "TxtTienThueNT";
            padding = new Padding(1);
            this.TxtTienThueNT.Padding = padding;
            this.TxtTienThueNT.ReadOnly = true;
            size = new Size(0x6d, 20);
            this.TxtTienThueNT.Size = size;
            this.TxtTienThueNT.TabIndex = 0x23;
            this.TxtTienThueNT.Tag = null;
            this.TxtTienThueNT.TextAlign = HorizontalAlignment.Right;
            num = new decimal(new int[] { 0, 0, 0, 0 });
            this.TxtTienThueNT.Value = num;
            this.TxtTienThueNT.VisibleButtons = DropDownControlButtonFlags.None;
            this.TxtTienThueNT.VisualStyle = C1.Win.C1Input.VisualStyle.Office2007Blue;
            this.TxtTienThueNT.VisualStyleBaseStyle = C1.Win.C1Input.VisualStyle.Office2007Blue;
            this.Label15.AutoEllipsis = true;
            this.Label15.AutoSize = true;
            this.Label15.Font = new Font("Microsoft Sans Serif", 8.25f, FontStyle.Bold, GraphicsUnit.Point, 0xa3);
            point = new Point(10, 0x1a);
            this.Label15.Location = point;
            this.Label15.Name = "Label15";
            this.Label15.RightToLeft = RightToLeft.No;
            size = new Size(0x3d, 13);
            this.Label15.Size = size;
            this.Label15.TabIndex = 0x22;
            this.Label15.Text = "Tiền thuế";
            this.Label15.TextAlign = ContentAlignment.TopRight;
            this.TxtTongCong.BorderStyle = BorderStyle.FixedSingle;
            this.TxtTongCong.FormatType = FormatTypeEnum.StandardNumber;
            point = new Point(0xc5, 0x43);
            this.TxtTongCong.Location = point;
            this.TxtTongCong.Name = "TxtTongCong";
            padding = new Padding(1);
            this.TxtTongCong.Padding = padding;
            this.TxtTongCong.ReadOnly = true;
            size = new Size(0x6d, 20);
            this.TxtTongCong.Size = size;
            this.TxtTongCong.TabIndex = 0x2a;
            this.TxtTongCong.Tag = null;
            this.TxtTongCong.TextAlign = HorizontalAlignment.Right;
            num = new decimal(new int[] { 0, 0, 0, 0 });
            this.TxtTongCong.Value = num;
            this.TxtTongCong.VisibleButtons = DropDownControlButtonFlags.None;
            this.TxtTongCong.VisualStyle = C1.Win.C1Input.VisualStyle.Office2007Blue;
            this.TxtTongCong.VisualStyleBaseStyle = C1.Win.C1Input.VisualStyle.Office2007Blue;
            this.TxtTongCongNT.BorderStyle = BorderStyle.FixedSingle;
            this.TxtTongCongNT.FormatType = FormatTypeEnum.StandardNumber;
            point = new Point(0x57, 0x43);
            this.TxtTongCongNT.Location = point;
            this.TxtTongCongNT.Name = "TxtTongCongNT";
            padding = new Padding(1);
            this.TxtTongCongNT.Padding = padding;
            this.TxtTongCongNT.ReadOnly = true;
            size = new Size(0x6d, 20);
            this.TxtTongCongNT.Size = size;
            this.TxtTongCongNT.TabIndex = 0x29;
            this.TxtTongCongNT.Tag = null;
            this.TxtTongCongNT.TextAlign = HorizontalAlignment.Right;
            num = new decimal(new int[] { 0, 0, 0, 0 });
            this.TxtTongCongNT.Value = num;
            this.TxtTongCongNT.VisibleButtons = DropDownControlButtonFlags.None;
            this.TxtTongCongNT.VisualStyle = C1.Win.C1Input.VisualStyle.Office2007Blue;
            this.TxtTongCongNT.VisualStyleBaseStyle = C1.Win.C1Input.VisualStyle.Office2007Blue;
            this.Label14.AutoEllipsis = true;
            this.Label14.AutoSize = true;
            this.Label14.Font = new Font("Microsoft Sans Serif", 8.25f, FontStyle.Bold, GraphicsUnit.Point, 0xa3);
            point = new Point(10, 70);
            this.Label14.Location = point;
            this.Label14.Name = "Label14";
            this.Label14.RightToLeft = RightToLeft.No;
            size = new Size(0x44, 13);
            this.Label14.Size = size;
            this.Label14.TabIndex = 40;
            this.Label14.Text = "Tổng cộng";
            this.Label14.TextAlign = ContentAlignment.TopRight;
            this.TxtCongThem.BorderStyle = BorderStyle.FixedSingle;
            this.TxtCongThem.FormatType = FormatTypeEnum.StandardNumber;
            point = new Point(0xc5, 0x2d);
            this.TxtCongThem.Location = point;
            this.TxtCongThem.Name = "TxtCongThem";
            padding = new Padding(1);
            this.TxtCongThem.Padding = padding;
            this.TxtCongThem.ReadOnly = true;
            size = new Size(0x6d, 20);
            this.TxtCongThem.Size = size;
            this.TxtCongThem.TabIndex = 0x27;
            this.TxtCongThem.Tag = null;
            this.TxtCongThem.TextAlign = HorizontalAlignment.Right;
            num = new decimal(new int[] { 0, 0, 0, 0 });
            this.TxtCongThem.Value = num;
            this.TxtCongThem.VisibleButtons = DropDownControlButtonFlags.None;
            this.TxtCongThem.VisualStyle = C1.Win.C1Input.VisualStyle.Office2007Blue;
            this.TxtCongThem.VisualStyleBaseStyle = C1.Win.C1Input.VisualStyle.Office2007Blue;
            this.TxtCongThemNT.BorderStyle = BorderStyle.FixedSingle;
            this.TxtCongThemNT.FormatType = FormatTypeEnum.StandardNumber;
            point = new Point(0x57, 0x2d);
            this.TxtCongThemNT.Location = point;
            this.TxtCongThemNT.Name = "TxtCongThemNT";
            padding = new Padding(1);
            this.TxtCongThemNT.Padding = padding;
            this.TxtCongThemNT.ReadOnly = true;
            size = new Size(0x6d, 20);
            this.TxtCongThemNT.Size = size;
            this.TxtCongThemNT.TabIndex = 0x26;
            this.TxtCongThemNT.Tag = null;
            this.TxtCongThemNT.TextAlign = HorizontalAlignment.Right;
            num = new decimal(new int[] { 0, 0, 0, 0 });
            this.TxtCongThemNT.Value = num;
            this.TxtCongThemNT.VisibleButtons = DropDownControlButtonFlags.None;
            this.TxtCongThemNT.VisualStyle = C1.Win.C1Input.VisualStyle.Office2007Blue;
            this.TxtCongThemNT.VisualStyleBaseStyle = C1.Win.C1Input.VisualStyle.Office2007Blue;
            this.Label12.AutoEllipsis = true;
            this.Label12.AutoSize = true;
            this.Label12.Font = new Font("Microsoft Sans Serif", 8.25f, FontStyle.Bold, GraphicsUnit.Point, 0xa3);
            point = new Point(10, 0x30);
            this.Label12.Location = point;
            this.Label12.Name = "Label12";
            this.Label12.RightToLeft = RightToLeft.No;
            size = new Size(0x43, 13);
            this.Label12.Size = size;
            this.Label12.TabIndex = 0x25;
            this.Label12.Text = "&Cộng th\x00eam";
            this.Label12.TextAlign = ContentAlignment.TopRight;
            this.TxtSoTienNT.BorderStyle = BorderStyle.FixedSingle;
            this.TxtSoTienNT.FormatType = FormatTypeEnum.StandardNumber;
            point = new Point(0x57, 1);
            this.TxtSoTienNT.Location = point;
            this.TxtSoTienNT.Name = "TxtSoTienNT";
            padding = new Padding(1);
            this.TxtSoTienNT.Padding = padding;
            this.TxtSoTienNT.ReadOnly = true;
            size = new Size(0x6d, 20);
            this.TxtSoTienNT.Size = size;
            this.TxtSoTienNT.TabIndex = 0x20;
            this.TxtSoTienNT.Tag = null;
            this.TxtSoTienNT.TextAlign = HorizontalAlignment.Right;
            num = new decimal(new int[] { 0, 0, 0, 0 });
            this.TxtSoTienNT.Value = num;
            this.TxtSoTienNT.VisibleButtons = DropDownControlButtonFlags.None;
            this.TxtSoTienNT.VisualStyle = C1.Win.C1Input.VisualStyle.Office2007Blue;
            this.TxtSoTienNT.VisualStyleBaseStyle = C1.Win.C1Input.VisualStyle.Office2007Blue;
            this.Label5.AutoEllipsis = true;
            this.Label5.AutoSize = true;
            this.Label5.Font = new Font("Microsoft Sans Serif", 8.25f, FontStyle.Bold, GraphicsUnit.Point, 0xa3);
            point = new Point(10, 4);
            this.Label5.Location = point;
            this.Label5.Name = "Label5";
            this.Label5.RightToLeft = RightToLeft.No;
            size = new Size(0x40, 13);
            this.Label5.Size = size;
            this.Label5.TabIndex = 0x1f;
            this.Label5.Text = "Tiền h\x00e0ng";
            this.Label5.TextAlign = ContentAlignment.TopRight;
            point = new Point(0x54, 0x34);
            this.TxtDiaChiNhaCungCap.Location = point;
            this.TxtDiaChiNhaCungCap.Multiline = true;
            this.TxtDiaChiNhaCungCap.Name = "TxtDiaChiNhaCungCap";
            size = new Size(0x12e, 30);
            this.TxtDiaChiNhaCungCap.Size = size;
            this.TxtDiaChiNhaCungCap.TabIndex = 7;
            this.CmdHelp.Alignment = ToolStripItemAlignment.Right;
            this.CmdHelp.Image = (Image) manager.GetObject("CmdHelp.Image");
            this.CmdHelp.ImageTransparentColor = Color.Magenta;
            this.CmdHelp.Name = "CmdHelp";
            size = new Size(0x34, 0x16);
            this.CmdHelp.Size = size;
            this.CmdHelp.Text = "&Help";
            this.CmdExit.Alignment = ToolStripItemAlignment.Right;
            this.CmdExit.Image = (Image) manager.GetObject("CmdExit.Image");
            this.CmdExit.ImageTransparentColor = Color.White;
            this.CmdExit.Name = "CmdExit";
            size = new Size(0x3a, 0x16);
            this.CmdExit.Size = size;
            this.CmdExit.Text = "Th&o\x00e1t";
            this.CboLanguage.Name = "CboLanguage";
            size = new Size(0x79, 0x19);
            this.CboLanguage.Size = size;
            this.CmdXacNhan.Image = ACCOUNTING.My.Resources.Resources.view;
            this.CmdXacNhan.ImageTransparentColor = Color.White;
            this.CmdXacNhan.Name = "CmdXacNhan";
            size = new Size(0x4c, 0x16);
            this.CmdXacNhan.Size = size;
            this.CmdXacNhan.Text = "X\x00e1c nhận";
            this.AdvNhaCungCap.Conditions = "";
            this.AdvNhaCungCap.LoaiDoiTuong = modGeneral.TypeObjects.NhaCungCap;
            point = new Point(0x54, 0x1d);
            this.AdvNhaCungCap.Location = point;
            this.AdvNhaCungCap.Name = "AdvNhaCungCap";
            this.AdvNhaCungCap.ReadOnly = false;
            size = new Size(0x12e, 20);
            this.AdvNhaCungCap.Size = size;
            this.AdvNhaCungCap.TabIndex = 5;
            this.AdvNhaCungCap.UpperText = true;
            this.AdvNhaCungCap.Value = "";
            this.AdvNhaCungCap.WidthCode = 80;
            this.Label17.AutoEllipsis = true;
            this.Label17.AutoSize = true;
            point = new Point(0x188, 0x71);
            this.Label17.Location = point;
            this.Label17.Name = "Label17";
            this.Label17.RightToLeft = RightToLeft.No;
            size = new Size(0x38, 13);
            this.Label17.Size = size;
            this.Label17.TabIndex = 0x18;
            this.Label17.Text = "Nh\x00e2n vi\x00ean";
            this.Label17.TextAlign = ContentAlignment.TopRight;
            this.AdvNhanVien.Conditions = "";
            this.AdvNhanVien.LoaiDoiTuong = modGeneral.TypeObjects.NhanVien;
            point = new Point(480, 0x6d);
            this.AdvNhanVien.Location = point;
            this.AdvNhanVien.Name = "AdvNhanVien";
            this.AdvNhanVien.ReadOnly = false;
            size = new Size(0x12a, 20);
            this.AdvNhanVien.Size = size;
            this.AdvNhanVien.TabIndex = 0x19;
            this.AdvNhanVien.UpperText = true;
            this.AdvNhanVien.Value = "";
            this.AdvNhanVien.WidthCode = 80;
            this.Label18.AutoSize = true;
            point = new Point(6, 0x70);
            this.Label18.Location = point;
            this.Label18.Name = "Label18";
            size = new Size(0x37, 13);
            this.Label18.Size = size;
            this.Label18.TabIndex = 10;
            this.Label18.Text = "Hợp đồng";
            point = new Point(0x54, 0x6d);
            this.TxtSoHopDong.Location = point;
            this.TxtSoHopDong.Name = "TxtSoHopDong";
            size = new Size(0x70, 20);
            this.TxtSoHopDong.Size = size;
            this.TxtSoHopDong.TabIndex = 11;
            this.CboLienHe.FormattingEnabled = true;
            point = new Point(0x54, 0x55);
            this.CboLienHe.Location = point;
            this.CboLienHe.Name = "CboLienHe";
            size = new Size(0x12e, 0x15);
            this.CboLienHe.Size = size;
            this.CboLienHe.TabIndex = 9;
            this.CboPhuongThucThanhToan.FormattingEnabled = true;
            point = new Point(0x27e, 0x1c);
            this.CboPhuongThucThanhToan.Location = point;
            this.CboPhuongThucThanhToan.Name = "CboPhuongThucThanhToan";
            size = new Size(140, 0x15);
            this.CboPhuongThucThanhToan.Size = size;
            this.CboPhuongThucThanhToan.TabIndex = 0x11;
            this.Label8.AutoSize = true;
            point = new Point(0x23c, 0x21);
            this.Label8.Location = point;
            this.Label8.Name = "Label8";
            size = new Size(0x3e, 13);
            this.Label8.Size = size;
            this.Label8.TabIndex = 0x10;
            this.Label8.Text = "Thanh to\x00e1n";
            this.Label8.TextAlign = ContentAlignment.TopRight;
            this.Label7.AutoSize = true;
            point = new Point(390, 0x21);
            this.Label7.Location = point;
            this.Label7.Name = "Label7";
            size = new Size(0x4d, 13);
            this.Label7.Size = size;
            this.Label7.TabIndex = 14;
            this.Label7.Text = "Hạn giao h\x00e0ng";
            this.TxtHanGiaoHang.Format = DateTimePickerFormat.Short;
            point = new Point(480, 0x1d);
            this.TxtHanGiaoHang.Location = point;
            this.TxtHanGiaoHang.Name = "TxtHanGiaoHang";
            size = new Size(90, 20);
            this.TxtHanGiaoHang.Size = size;
            this.TxtHanGiaoHang.TabIndex = 15;
            point = new Point(480, 0x34);
            this.TxtDiaChiGiaoHang.Location = point;
            this.TxtDiaChiGiaoHang.Multiline = true;
            this.TxtDiaChiGiaoHang.Name = "TxtDiaChiGiaoHang";
            size = new Size(0x12a, 30);
            this.TxtDiaChiGiaoHang.Size = size;
            this.TxtDiaChiGiaoHang.TabIndex = 0x13;
            this.Label6.AutoEllipsis = true;
            this.Label6.AutoSize = true;
            point = new Point(390, 0x38);
            this.Label6.Location = point;
            this.Label6.Name = "Label6";
            this.Label6.RightToLeft = RightToLeft.No;
            size = new Size(90, 13);
            this.Label6.Size = size;
            this.Label6.TabIndex = 0x12;
            this.Label6.Text = "Địa chỉ giao h\x00e0ng";
            this.Label6.TextAlign = ContentAlignment.TopRight;
            this.CboPhuongThucVanChuyen.FormattingEnabled = true;
            point = new Point(480, 5);
            this.CboPhuongThucVanChuyen.Location = point;
            this.CboPhuongThucVanChuyen.Name = "CboPhuongThucVanChuyen";
            size = new Size(0x12a, 0x15);
            this.CboPhuongThucVanChuyen.Size = size;
            this.CboPhuongThucVanChuyen.TabIndex = 14;
            this.Label4.AutoSize = true;
            point = new Point(390, 9);
            this.Label4.Location = point;
            this.Label4.Name = "Label4";
            size = new Size(0x40, 13);
            this.Label4.Size = size;
            this.Label4.TabIndex = 12;
            this.Label4.Text = "Vận chuyển";
            this.Label4.TextAlign = ContentAlignment.TopRight;
            this.Label2.AutoEllipsis = true;
            this.Label2.AutoSize = true;
            point = new Point(4, 0x56);
            this.Label2.Location = point;
            this.Label2.Name = "Label2";
            this.Label2.RightToLeft = RightToLeft.No;
            size = new Size(0x45, 13);
            this.Label2.Size = size;
            this.Label2.TabIndex = 8;
            this.Label2.Text = "Người li\x00ean hệ";
            this.Label2.TextAlign = ContentAlignment.TopRight;
            this.Label16.AutoEllipsis = true;
            this.Label16.AutoSize = true;
            point = new Point(4, 0x20);
            this.Label16.Location = point;
            this.Label16.Name = "Label16";
            this.Label16.RightToLeft = RightToLeft.No;
            size = new Size(0x4b, 13);
            this.Label16.Size = size;
            this.Label16.TabIndex = 4;
            this.Label16.Text = "Nh\x00e0 cung cấp";
            this.Label16.TextAlign = ContentAlignment.TopRight;
            point = new Point(0x54, 0x84);
            this.TxtDienGiai.Location = point;
            this.TxtDienGiai.Name = "TxtDienGiai";
            size = new Size(0x2b6, 20);
            this.TxtDienGiai.Size = size;
            this.TxtDienGiai.TabIndex = 0x1a;
            this.Label9.AutoEllipsis = true;
            this.Label9.AutoSize = true;
            point = new Point(5, 0x87);
            this.Label9.Location = point;
            this.Label9.Name = "Label9";
            this.Label9.RightToLeft = RightToLeft.No;
            size = new Size(0x30, 13);
            this.Label9.Size = size;
            this.Label9.TabIndex = 0x16;
            this.Label9.Text = "Diễn giải";
            this.Label9.TextAlign = ContentAlignment.TopRight;
            this.ToolStripSeparator2.Name = "ToolStripSeparator2";
            size = new Size(6, 0x19);
            this.ToolStripSeparator2.Size = size;
            this.TabPage1.Controls.Add(this.Label17);
            this.TabPage1.Controls.Add(this.AdvNhanVien);
            this.TabPage1.Controls.Add(this.Label18);
            this.TabPage1.Controls.Add(this.TxtSoHopDong);
            this.TabPage1.Controls.Add(this.CboLienHe);
            this.TabPage1.Controls.Add(this.CboPhuongThucThanhToan);
            this.TabPage1.Controls.Add(this.Label8);
            this.TabPage1.Controls.Add(this.Label7);
            this.TabPage1.Controls.Add(this.TxtHanGiaoHang);
            this.TabPage1.Controls.Add(this.TxtDiaChiGiaoHang);
            this.TabPage1.Controls.Add(this.Label6);
            this.TabPage1.Controls.Add(this.CboPhuongThucVanChuyen);
            this.TabPage1.Controls.Add(this.Label4);
            this.TabPage1.Controls.Add(this.Label2);
            this.TabPage1.Controls.Add(this.Label16);
            this.TabPage1.Controls.Add(this.AdvNhaCungCap);
            this.TabPage1.Controls.Add(this.TxtDienGiai);
            this.TabPage1.Controls.Add(this.Label9);
            this.TabPage1.Controls.Add(this.TxtDiaChiNhaCungCap);
            this.TabPage1.Controls.Add(this.Label3);
            this.TabPage1.Controls.Add(this.CboLoaiTien);
            this.TabPage1.Controls.Add(this.txtTyGia);
            this.TabPage1.Controls.Add(this.Label11);
            this.TabPage1.Controls.Add(this.Label10);
            this.TabPage1.Controls.Add(this.Label13);
            this.TabPage1.Controls.Add(this.TxtNgayChungTu);
            this.TabPage1.Controls.Add(this.Label1);
            this.TabPage1.Controls.Add(this.TxtSoChungTu);
            point = new Point(4, 0x16);
            this.TabPage1.Location = point;
            this.TabPage1.Name = "TabPage1";
            padding = new Padding(3);
            this.TabPage1.Padding = padding;
            size = new Size(0x376, 0x9b);
            this.TabPage1.Size = size;
            this.TabPage1.TabIndex = 0;
            this.TabPage1.Text = "Th\x00f4ng tin đơn đặt h\x00e0ng";
            this.TabPage1.UseVisualStyleBackColor = true;
            this.Label3.AutoEllipsis = true;
            this.Label3.AutoSize = true;
            point = new Point(4, 0x38);
            this.Label3.Location = point;
            this.Label3.Name = "Label3";
            this.Label3.RightToLeft = RightToLeft.No;
            size = new Size(40, 13);
            this.Label3.Size = size;
            this.Label3.TabIndex = 6;
            this.Label3.Text = "Địa chỉ";
            this.Label3.TextAlign = ContentAlignment.TopRight;
            this.CboLoaiTien.FormattingEnabled = true;
            point = new Point(480, 0x55);
            this.CboLoaiTien.Location = point;
            this.CboLoaiTien.Name = "CboLoaiTien";
            size = new Size(0x68, 0x15);
            this.CboLoaiTien.Size = size;
            this.CboLoaiTien.TabIndex = 0x15;
            this.txtTyGia.BorderStyle = BorderStyle.FixedSingle;
            this.txtTyGia.DataType = typeof(double);
            this.txtTyGia.FormatType = FormatTypeEnum.Currency;
            point = new Point(0x2a6, 0x55);
            this.txtTyGia.Location = point;
            this.txtTyGia.Name = "txtTyGia";
            padding = new Padding(1);
            this.txtTyGia.Padding = padding;
            size = new Size(100, 20);
            this.txtTyGia.Size = size;
            this.txtTyGia.TabIndex = 0x17;
            this.txtTyGia.Tag = null;
            this.txtTyGia.TextAlign = HorizontalAlignment.Right;
            this.txtTyGia.VisibleButtons = DropDownControlButtonFlags.DropDown;
            this.txtTyGia.VisualStyle = C1.Win.C1Input.VisualStyle.Office2007Blue;
            this.txtTyGia.VisualStyleBaseStyle = C1.Win.C1Input.VisualStyle.Office2007Blue;
            this.Label11.AutoSize = true;
            point = new Point(390, 0x58);
            this.Label11.Location = point;
            this.Label11.Name = "Label11";
            size = new Size(0x2f, 13);
            this.Label11.Size = size;
            this.Label11.TabIndex = 20;
            this.Label11.Text = "Loại tiền";
            this.Label11.TextAlign = ContentAlignment.TopRight;
            this.Label10.AutoSize = true;
            point = new Point(0x270, 0x58);
            this.Label10.Location = point;
            this.Label10.Name = "Label10";
            size = new Size(0x24, 13);
            this.Label10.Size = size;
            this.Label10.TabIndex = 0x16;
            this.Label10.Text = "Tỷ gi\x00e1";
            this.Label10.TextAlign = ContentAlignment.TopRight;
            this.Label13.AutoSize = true;
            point = new Point(0xf8, 9);
            this.Label13.Location = point;
            this.Label13.Name = "Label13";
            size = new Size(0x20, 13);
            this.Label13.Size = size;
            this.Label13.TabIndex = 2;
            this.Label13.Text = "Ng\x00e0y";
            this.TxtNgayChungTu.Format = DateTimePickerFormat.Short;
            point = new Point(0x11e, 6);
            this.TxtNgayChungTu.Location = point;
            this.TxtNgayChungTu.Name = "TxtNgayChungTu";
            size = new Size(100, 20);
            this.TxtNgayChungTu.Size = size;
            this.TxtNgayChungTu.TabIndex = 3;
            this.Label1.AutoSize = true;
            point = new Point(4, 9);
            this.Label1.Location = point;
            this.Label1.Name = "Label1";
            size = new Size(0x41, 13);
            this.Label1.Size = size;
            this.Label1.TabIndex = 0;
            this.Label1.Text = "Số chứng từ";
            point = new Point(0x54, 6);
            this.TxtSoChungTu.Location = point;
            this.TxtSoChungTu.Name = "TxtSoChungTu";
            size = new Size(0x70, 20);
            this.TxtSoChungTu.Size = size;
            this.TxtSoChungTu.TabIndex = 1;
            this.CmdUnsave.Image = (Image) manager.GetObject("CmdUnsave.Image");
            this.CmdUnsave.ImageTransparentColor = Color.White;
            this.CmdUnsave.Name = "CmdUnsave";
            size = new Size(0x39, 0x16);
            this.CmdUnsave.Size = size;
            this.CmdUnsave.Text = "&K.Lưu";
            this.CmdUnsave.ToolTipText = "F11 Kh\x00f4ng lưu th\x00f4ng tin thay đổi";
            this.TabControl1.Controls.Add(this.TabPage1);
            this.TabControl1.Dock = DockStyle.Top;
            point = new Point(0, 0x19);
            this.TabControl1.Location = point;
            this.TabControl1.Name = "TabControl1";
            this.TabControl1.SelectedIndex = 0;
            size = new Size(0x37e, 0xb5);
            this.TabControl1.Size = size;
            this.TabControl1.TabIndex = 0x26;
            this.CmdInTiengAnh.Name = "CmdInTiengAnh";
            size = new Size(0x81, 0x16);
            this.CmdInTiengAnh.Size = size;
            this.CmdInTiengAnh.Text = "Tiếng Anh";
            this.CmdInTiengViet.Name = "CmdInTiengViet";
            size = new Size(0x81, 0x16);
            this.CmdInTiengViet.Size = size;
            this.CmdInTiengViet.Text = "Tiếng Việt";
            this.CmdPrint.DropDownItems.AddRange(new ToolStripItem[] { this.CmdInTiengViet, this.CmdInTiengAnh });
            this.CmdPrint.Image = (Image) manager.GetObject("CmdPrint.Image");
            this.CmdPrint.ImageTransparentColor = Color.White;
            this.CmdPrint.Name = "CmdPrint";
            size = new Size(0x2e, 0x16);
            this.CmdPrint.Size = size;
            this.CmdPrint.Text = "&In";
            this.CmdPrint.ToolTipText = "F12 In đơn đặt h\x00e0ng";
            this.ToolStripSeparator3.Name = "ToolStripSeparator3";
            size = new Size(6, 0x19);
            this.ToolStripSeparator3.Size = size;
            this.CmdDel.Image = (Image) manager.GetObject("CmdDel.Image");
            this.CmdDel.ImageTransparentColor = Color.White;
            this.CmdDel.Name = "CmdDel";
            size = new Size(0x2f, 0x16);
            this.CmdDel.Size = size;
            this.CmdDel.Text = "&X\x00f3a";
            this.CmdDel.ToolTipText = "F9 X\x00f3a đơn đặt h\x00e0ng";
            this.ToolStripButton1.Name = "ToolStripButton1";
            size = new Size(6, 0x19);
            this.ToolStripButton1.Size = size;
            this.CmdEdit.Image = (Image) manager.GetObject("CmdEdit.Image");
            this.CmdEdit.ImageTransparentColor = Color.White;
            this.CmdEdit.Name = "CmdEdit";
            size = new Size(0x2e, 0x16);
            this.CmdEdit.Size = size;
            this.CmdEdit.Text = "&Sửa";
            this.CmdEdit.ToolTipText = "F2 Chỉnh sửa đơn đặt h\x00e0ng";
            this.CmdAdd.Image = (Image) manager.GetObject("CmdAdd.Image");
            this.CmdAdd.ImageTransparentColor = Color.White;
            this.CmdAdd.Name = "CmdAdd";
            size = new Size(0x52, 0x16);
            this.CmdAdd.Size = size;
            this.CmdAdd.Text = "&Th\x00eam mới";
            this.CmdAdd.ToolTipText = "F8 Th\x00eam mới đơn đặt h\x00e0ng";
            this.ToolStrip1.BackgroundImage = ACCOUNTING.My.Resources.Resources.bgbluenoborder;
            this.ToolStrip1.Items.AddRange(new ToolStripItem[] { this.CmdAdd, this.CmdEdit, this.ToolStripSeparator2, this.CmdSave, this.CmdUnsave, this.ToolStripSeparator1, this.CmdFind, this.CmdPrint, this.ToolStripButton1, this.CmdDel, this.ToolStripSeparator3, this.CmdExit, this.CmdHelp, this.CmdXacNhan, this.CboLanguage });
            point = new Point(0, 0);
            this.ToolStrip1.Location = point;
            this.ToolStrip1.Name = "ToolStrip1";
            size = new Size(0x37e, 0x19);
            this.ToolStrip1.Size = size;
            this.ToolStrip1.TabIndex = 40;
            this.ToolStrip1.Text = "ToolStrip1";
            this.CmdSave.Image = (Image) manager.GetObject("CmdSave.Image");
            this.CmdSave.ImageTransparentColor = Color.WhiteSmoke;
            this.CmdSave.Name = "CmdSave";
            size = new Size(0x2f, 0x16);
            this.CmdSave.Size = size;
            this.CmdSave.Text = "&Lưu";
            this.CmdSave.ToolTipText = "F10 Lưu th\x00f4ng tin thay đổi";
            this.ToolStripSeparator1.Name = "ToolStripSeparator1";
            size = new Size(6, 0x19);
            this.ToolStripSeparator1.Size = size;
            this.CmdFind.Image = (Image) manager.GetObject("CmdFind.Image");
            this.CmdFind.ImageTransparentColor = Color.White;
            this.CmdFind.Name = "CmdFind";
            size = new Size(0x4d, 0x16);
            this.CmdFind.Size = size;
            this.CmdFind.Text = "T\x00ecm kiếm";
            this.CmdFind.ToolTipText = "F3 T\x00ecm kiếm đơn đặt h\x00e0ng";
            SizeF ef = new SizeF(6f, 13f);
            this.AutoScaleDimensions = ef;
            this.AutoScaleMode = AutoScaleMode.Font;
            size = new Size(0x37e, 0x238);
            this.ClientSize = size;
            this.ControlBox = false;
            this.Controls.Add(this.TabDetails);
            this.Controls.Add(this.Panel4);
            this.Controls.Add(this.TabControl1);
            this.Controls.Add(this.ToolStrip1);
            this.FormBorderStyle = FormBorderStyle.FixedDialog;
            this.Name = "Frm_YeuCauBaoGia";
            this.ShowIcon = false;
            this.StartPosition = FormStartPosition.CenterScreen;
            this.Text = "YEU CAU BAO GIA";
            this.TabDetails.ResumeLayout(false);
            this.TabPage4.ResumeLayout(false);
            this.VSlist.EndInit();
            ((ISupportInitialize) this.TxtSoTien).EndInit();
            this.Panel4.ResumeLayout(false);
            this.Panel4.PerformLayout();
            this.Panel5.ResumeLayout(false);
            this.Panel5.PerformLayout();
            ((ISupportInitialize) this.TxtTienThue).EndInit();
            ((ISupportInitialize) this.TxtTienThueNT).EndInit();
            ((ISupportInitialize) this.TxtTongCong).EndInit();
            ((ISupportInitialize) this.TxtTongCongNT).EndInit();
            ((ISupportInitialize) this.TxtCongThem).EndInit();
            ((ISupportInitialize) this.TxtCongThemNT).EndInit();
            ((ISupportInitialize) this.TxtSoTienNT).EndInit();
            this.TabPage1.ResumeLayout(false);
            this.TabPage1.PerformLayout();
            ((ISupportInitialize) this.txtTyGia).EndInit();
            this.TabControl1.ResumeLayout(false);
            this.ToolStrip1.ResumeLayout(false);
            this.ToolStrip1.PerformLayout();
            this.ResumeLayout(false);
            this.PerformLayout();
        }

        public bool SaveTemp()
        {
            C1.Win.C1FlexGrid.C1FlexGrid vSlist = this.VSlist;
            int num2 = this.VSlist.Rows.Count - 1;
            for (int i = 1; i <= num2; i++)
            {
                if (LVYModule.ReturnIfNull(RuntimeHelpers.GetObjectValue(vSlist[i, 0]), "", modGeneral.TypeOfValue.Nothing).ToString().Trim() == "")
                {
                    vSlist[i, 0] = modGeneral.CreatKey("BH_DonDatHangChiTiet", 15, "");
                }
                this.objDHCT.Khoa = Conversions.ToString(vSlist[i, 0]);
                this.objDHCT.KhoaDonDatHang = this.cFrmKhoa;
                this.objDHCT.KhoaHangHoa = Conversions.ToString(vSlist[i, 1]);
                this.objDHCT.KhoaDonViTinh = LVYModule.ReturnIfNull(RuntimeHelpers.GetObjectValue(vSlist[i, 4]), "", modGeneral.TypeOfValue.Nothing).ToString();
                this.objDHCT.QuyCach = Conversions.ToDouble(LVYModule.ReturnIfNull(RuntimeHelpers.GetObjectValue(vSlist[i, 6]), 1, modGeneral.TypeOfValue.Nothing));
                this.objDHCT.SoLuong = Conversions.ToDouble(LVYModule.ReturnIfNull(RuntimeHelpers.GetObjectValue(vSlist[i, 7]), 0, modGeneral.TypeOfValue.Nothing));
                this.objDHCT.DonGiaNT = Conversions.ToDouble(LVYModule.ReturnIfNull(RuntimeHelpers.GetObjectValue(vSlist[i, 8]), 0, modGeneral.TypeOfValue.Nothing));
                this.objDHCT.DonGia = this.objDHCT.DonGiaNT * Conversions.ToDouble(LVYModule.ReturnIfNull(RuntimeHelpers.GetObjectValue(this.txtTyGia.Value), 1, modGeneral.TypeOfValue.Nothing));
                this.objDHCT.ThanhTienNT = Conversions.ToDouble(LVYModule.ReturnIfNull(RuntimeHelpers.GetObjectValue(vSlist[i, 9]), 0, modGeneral.TypeOfValue.Nothing));
                this.objDHCT.ThanhTien = this.objDHCT.ThanhTienNT * Conversions.ToDouble(LVYModule.ReturnIfNull(RuntimeHelpers.GetObjectValue(this.txtTyGia.Value), 1, modGeneral.TypeOfValue.Nothing));
                this.objDHCT.SoLuongCungCap = 0.0;
                this.objDHCT.ThueSuat = Conversions.ToInteger(LVYModule.ReturnIfNull(RuntimeHelpers.GetObjectValue(vSlist[i, 10]), 0, modGeneral.TypeOfValue.Nothing));
                this.objDHCT.TienThueNT = Conversions.ToDouble(LVYModule.ReturnIfNull(RuntimeHelpers.GetObjectValue(vSlist[i, 11]), 0, modGeneral.TypeOfValue.Nothing));
                this.objDHCT.TienThue = this.objDHCT.TienThueNT * Conversions.ToDouble(LVYModule.ReturnIfNull(RuntimeHelpers.GetObjectValue(this.txtTyGia.Value), 1, modGeneral.TypeOfValue.Nothing));
                this.objDHCT.TriGiaCungCapNT = 0.0;
                this.objDHCT.TriGiaCungCap = 0.0;
                if (!this.objDHCT.Save())
                {
                    return false;
                }
            }
            vSlist = null;
            return true;
        }

        public void ShowData(string strKhoa)
        {
            this.objDH.Load(strKhoa);
            clsDonDatHang objDH = this.objDH;
            this.cFrmKhoa = objDH.Khoa;
            this.TxtSoChungTu.Text = objDH.SoChungTu;
            this.TxtNgayChungTu.Text = LVYModule.Char2Date(objDH.NgayChungTu);
            this.AdvNhaCungCap.Value = objDH.KhoaDoiTuong;
            this.TxtDiaChiNhaCungCap.Text = objDH.DiaChiDoiTuong;
            this.CboLienHe.Text = objDH.NguoiLienHe.Trim();
            this.TxtHanGiaoHang.Text = LVYModule.Char2Date(objDH.NgayCungCap);
            this.AdvNhanVien.Value = objDH.KhoaNhanVien;
            this.TxtDiaChiGiaoHang.Text = objDH.DiaChiGiaoHang;
            this.TxtSoHopDong.Text = objDH.SoHopDong;
            this.CboPhuongThucVanChuyen.SelectedValue = objDH.PhuongThucGiaoHang;
            this.CboPhuongThucThanhToan.SelectedValue = objDH.PhuongThucThanhToan;
            this.TxtDienGiai.Text = objDH.DienGiai;
            this.CboLoaiTien.SelectedValue = objDH.LoaiTien;
            this.txtTyGia.Value = objDH.TyGia;
            this.TxtSoTienNT.Value = objDH.TienHangNT;
            this.TxtSoTien.Value = objDH.TienHang;
            this.TxtTienThueNT.Value = objDH.TienThueNT;
            this.TxtTienThue.Value = objDH.TienThue;
            this.TxtCongThemNT.Value = objDH.TienPhiNT;
            this.TxtCongThem.Value = objDH.TienPhi;
            this.TxtTongCongNT.Value = (objDH.TienHangNT + objDH.TienThueNT) + objDH.TienPhiNT;
            this.TxtTongCong.Value = (objDH.TienHang + objDH.TienThue) + objDH.TienPhi;
            this.CboTinhTrang.SelectedValue = objDH.TinhTrang;
            objDH = null;
            this.VSlist.Rows.Count = 1;
            DataTable details = this.objDH.GetDetails(strKhoa);
            if (details != null)
            {
                int num2 = details.Rows.Count - 1;
                for (int i = 0; i <= num2; i++)
                {
                    C1.Win.C1FlexGrid.C1FlexGrid vSlist = this.VSlist;
                    vSlist.AddItem("");
                    vSlist[vSlist.Rows.Count - 1, 0] = RuntimeHelpers.GetObjectValue(details.Rows[i]["Khoa"]);
                    vSlist[vSlist.Rows.Count - 1, 1] = RuntimeHelpers.GetObjectValue(details.Rows[i]["KhoaHangHoa"]);
                    vSlist[vSlist.Rows.Count - 1, 2] = RuntimeHelpers.GetObjectValue(details.Rows[i]["MaHang"]);
                    vSlist[vSlist.Rows.Count - 1, 3] = RuntimeHelpers.GetObjectValue(details.Rows[i]["HangHoa"]);
                    vSlist[vSlist.Rows.Count - 1, 4] = RuntimeHelpers.GetObjectValue(details.Rows[i]["KhoaDonViTinh"]);
                    vSlist[vSlist.Rows.Count - 1, 5] = RuntimeHelpers.GetObjectValue(details.Rows[i]["DonViTinh"]);
                    vSlist[vSlist.Rows.Count - 1, 6] = RuntimeHelpers.GetObjectValue(details.Rows[i]["QuyCach"]);
                    vSlist[vSlist.Rows.Count - 1, 7] = RuntimeHelpers.GetObjectValue(details.Rows[i]["SoLuong"]);
                    vSlist[vSlist.Rows.Count - 1, 8] = RuntimeHelpers.GetObjectValue(details.Rows[i]["DonGiaNT"]);
                    vSlist[vSlist.Rows.Count - 1, 9] = RuntimeHelpers.GetObjectValue(details.Rows[i]["ThanhTienNT"]);
                    vSlist[vSlist.Rows.Count - 1, 10] = RuntimeHelpers.GetObjectValue(details.Rows[i]["ThueSuat"]);
                    vSlist[vSlist.Rows.Count - 1, 11] = RuntimeHelpers.GetObjectValue(details.Rows[i]["TienThueNT"]);
                    vSlist = null;
                }
            }
        }

        public void TinhTienHang(int nRow)
        {
            double num = 0.0;
            double num2 = 0.0;
            num2 = Conversions.ToDouble(LVYModule.ReturnIfNull(RuntimeHelpers.GetObjectValue(this.VSlist[nRow, 7]), 0, modGeneral.TypeOfValue.Nothing));
            num = Conversions.ToDouble(LVYModule.ReturnIfNull(RuntimeHelpers.GetObjectValue(this.VSlist[nRow, 8]), 0, modGeneral.TypeOfValue.Nothing));
            this.VSlist[nRow, 9] = num2 * num;
        }

        public void TinhTienThue(int nRow)
        {
            double num2 = 0.0;
            int num = 0;
            num = Conversions.ToInteger(LVYModule.ReturnIfNull(RuntimeHelpers.GetObjectValue(this.VSlist[nRow, 10]), 0, modGeneral.TypeOfValue.Nothing));
            num2 = Conversions.ToDouble(LVYModule.ReturnIfNull(RuntimeHelpers.GetObjectValue(this.VSlist[nRow, 9]), 0, modGeneral.TypeOfValue.Nothing));
            this.VSlist[nRow, 11] = Math.Round((double) ((num2 * num) / 100.0), 0);
        }

        public void TinhTong()
        {
            this.TxtSoTienNT.Value = LVYModule.SumColGrid(this.VSlist, 9);
            this.TxtSoTien.Value = Conversions.ToDouble(LVYModule.ReturnIfNull(RuntimeHelpers.GetObjectValue(this.TxtSoTienNT.Value), 0, modGeneral.TypeOfValue.Nothing)) * Conversions.ToDouble(LVYModule.ReturnIfNull(RuntimeHelpers.GetObjectValue(this.txtTyGia.Value), 1, modGeneral.TypeOfValue.Nothing));
            this.TxtTienThueNT.Value = LVYModule.SumColGrid(this.VSlist, 11);
            this.TxtTienThue.Value = Conversions.ToDouble(LVYModule.ReturnIfNull(RuntimeHelpers.GetObjectValue(this.TxtTienThueNT.Value), 0, modGeneral.TypeOfValue.Nothing)) * Conversions.ToDouble(LVYModule.ReturnIfNull(RuntimeHelpers.GetObjectValue(this.txtTyGia.Value), 1, modGeneral.TypeOfValue.Nothing));
            this.TxtTongCongNT.Value = (Conversions.ToDouble(LVYModule.ReturnIfNull(RuntimeHelpers.GetObjectValue(this.TxtSoTienNT.Value), 0, modGeneral.TypeOfValue.Nothing)) + Conversions.ToDouble(LVYModule.ReturnIfNull(RuntimeHelpers.GetObjectValue(this.TxtTienThueNT.Value), 0, modGeneral.TypeOfValue.Nothing))) + Conversions.ToDouble(LVYModule.ReturnIfNull(RuntimeHelpers.GetObjectValue(this.TxtCongThemNT.Value), 0, modGeneral.TypeOfValue.Nothing));
            this.TxtTongCong.Value = (Conversions.ToDouble(LVYModule.ReturnIfNull(RuntimeHelpers.GetObjectValue(this.TxtSoTien.Value), 0, modGeneral.TypeOfValue.Nothing)) + Conversions.ToDouble(LVYModule.ReturnIfNull(RuntimeHelpers.GetObjectValue(this.TxtTienThue.Value), 0, modGeneral.TypeOfValue.Nothing))) + Conversions.ToDouble(LVYModule.ReturnIfNull(RuntimeHelpers.GetObjectValue(this.TxtCongThem.Value), 0, modGeneral.TypeOfValue.Nothing));
        }

        private void TxtCongThemNT_LostFocus(object sender, EventArgs e)
        {
            this.TxtCongThem.Value = Conversions.ToDouble(LVYModule.ReturnIfNull(RuntimeHelpers.GetObjectValue(this.TxtCongThemNT.Value), 0, modGeneral.TypeOfValue.Nothing)) * Conversions.ToDouble(LVYModule.ReturnIfNull(RuntimeHelpers.GetObjectValue(this.txtTyGia.Value), 0, modGeneral.TypeOfValue.Nothing));
            this.TinhTong();
        }

        public bool UpdateData()
        {
            bool flag=false;
            clsDonDatHang objDH = this.objDH;
            objDH.Khoa = this.cFrmKhoa;
            objDH.SoChungTu = this.TxtSoChungTu.Text.Trim();
            objDH.NgayChungTu = LVYModule.Date2Char(this.TxtNgayChungTu.Text);
            objDH.KhoaDoiTuong = this.AdvNhaCungCap.Value;
            objDH.DiaChiDoiTuong = this.TxtDiaChiNhaCungCap.Text.Trim();
            objDH.NguoiLienHe = this.CboLienHe.Text.Trim();
            objDH.NgayCungCap = LVYModule.Date2Char(this.TxtHanGiaoHang.Text);
            objDH.HanGiaoCuoi = LVYModule.Date2Char(this.TxtHanGiaoHang.Text);
            objDH.KhoaNhanVien = this.AdvNhanVien.Value;
            objDH.DiaChiGiaoHang = this.TxtDiaChiGiaoHang.Text.Trim();
            objDH.SoHopDong = this.TxtSoHopDong.Text.Trim();
            objDH.PhuongThucGiaoHang = Conversions.ToString(this.CboPhuongThucVanChuyen.SelectedValue);
            objDH.PhuongThucThanhToan = Conversions.ToString(this.CboPhuongThucThanhToan.SelectedValue);
            objDH.DienGiai = this.TxtDienGiai.Text.Trim();
            objDH.LoaiChungTu = "PO";
            objDH.LoaiTien = Conversions.ToString(this.CboLoaiTien.SelectedValue);
            objDH.TyGia = Conversions.ToDouble(LVYModule.ReturnIfNull(RuntimeHelpers.GetObjectValue(this.txtTyGia.Value), 1, modGeneral.TypeOfValue.Nothing));
            objDH.TienHangNT = Conversions.ToDouble(this.TxtSoTienNT.Value);
            objDH.TienHang = Conversions.ToDouble(this.TxtSoTien.Value);
            objDH.TienPhiNT = Conversions.ToDouble(this.TxtCongThemNT.Value);
            objDH.TienPhi = Conversions.ToDouble(this.TxtCongThem.Value);
            objDH.KhoaBaoGia = "";
            objDH.KhoaDonVi = modGeneral.H_CLIENT;
            objDH.KhoaNhanVienTao = modGeneral.H_USERID;
            objDH.NgayTao = LVYModule.Date2Char(Strings.Format(DateAndTime.Today, "dd/MM/yyyy"));
            objDH.KhoaNhanVienSua = modGeneral.H_USERID;
            objDH.NgaySua = LVYModule.Date2Char(Strings.Format(DateAndTime.Today, "dd/MM/yyyy"));
            objDH.TinhTrang = Conversions.ToString(this.CboTinhTrang.SelectedValue);
            return objDH.Save();
            objDH = null;
            return flag;
        }

        private void VSlist_AfterEdit(object sender, RowColEventArgs e)
        {
            string expression = "";
            switch (e.Col)
            {
                case 2:
                {
                    expression = SearchModule.SearchHangHoa(Conversions.ToString(this.VSlist[e.Row, e.Col]), "", "");
                    if (expression.Trim() == "")
                    {
                        this.VSlist[e.Row, 1] = "";
                        this.VSlist[e.Row, 2] = "";
                        this.VSlist[e.Row, 3] = "";
                        break;
                    }
                    object instance = Strings.Split(expression, "|", -1, CompareMethod.Binary);
                    this.VSlist[e.Row, 1] = RuntimeHelpers.GetObjectValue(NewLateBinding.LateIndexGet(instance, new object[] { 0 }, null));
                    this.VSlist[e.Row, 2] = RuntimeHelpers.GetObjectValue(NewLateBinding.LateIndexGet(instance, new object[] { 1 }, null));
                    this.VSlist[e.Row, 3] = RuntimeHelpers.GetObjectValue(NewLateBinding.LateIndexGet(instance, new object[] { 2 }, null));
                    clsDMHangHoa hoa = new clsDMHangHoa();
                    DataTable hangHoa = hoa.GetHangHoa(NewLateBinding.LateIndexGet(instance, new object[] { 0 }, null).ToString());
                    this.VSlist[e.Row, 4] = RuntimeHelpers.GetObjectValue(hangHoa.Rows[0]["KhoaDonViTinh"]);
                    this.VSlist[e.Row, 5] = RuntimeHelpers.GetObjectValue(hangHoa.Rows[0]["DonViTinh"]);
                    this.VSlist[e.Row, 6] = 1;
                    this.VSlist[e.Row, 7] = 1;
                    this.VSlist[e.Row, 8] = hoa.GetGiaMua(LVYModule.ReturnIfNull(RuntimeHelpers.GetObjectValue(this.CboLoaiTien.SelectedValue), "", modGeneral.TypeOfValue.String).ToString().Trim(), NewLateBinding.LateIndexGet(instance, new object[] { 0 }, null).ToString());
                    this.VSlist[e.Row, 9] = 0;
                    this.VSlist[e.Row, 10] = 0;
                    this.VSlist[e.Row, 11] = 0;
                    break;
                }
                case 7:
                case 8:
                    this.TinhTienHang(e.Row);
                    goto Label_0326;

                case 10:
                    this.TinhTienThue(e.Row);
                    goto Label_0326;

                default:
                    goto Label_0326;
            }
            this.VSlist.Select(e.Row, 7);
        Label_0326:
            this.TinhTong();
        }

        private void VSlist_BeforeEdit(object sender, RowColEventArgs e)
        {
            if (!this.mEnabledControl)
            {
                e.Cancel = true;
            }
            else if (((e.Col == 3) | (e.Col == 4)) | (e.Col == 6))
            {
                e.Cancel = true;
            }
        }

        private void VSlist_CellButtonClick(object sender, RowColEventArgs e)
        {
            if (e.Col == 5)
            {
                object instance = SearchModule.SearchDVT(LVYModule.ReturnIfNull(RuntimeHelpers.GetObjectValue(this.VSlist[e.Row, 1]), "", modGeneral.TypeOfValue.Nothing).ToString().Trim(), this.VSlist, e.Row, e.Col, LVYModule.ReturnIfNull(RuntimeHelpers.GetObjectValue(this.VSlist[e.Row, 4]), "", modGeneral.TypeOfValue.Nothing).ToString().Trim());
                if ((instance != null) && (Information.UBound((Array) instance, 1) >= 2))
                {
                    this.VSlist[e.Row, 4] = RuntimeHelpers.GetObjectValue(NewLateBinding.LateIndexGet(instance, new object[] { 0 }, null));
                    this.VSlist[e.Row, 5] = RuntimeHelpers.GetObjectValue(NewLateBinding.LateIndexGet(instance, new object[] { 1 }, null));
                    this.VSlist[e.Row, 6] = RuntimeHelpers.GetObjectValue(NewLateBinding.LateIndexGet(instance, new object[] { 2 }, null));
                }
            }
        }

        internal virtual ADVObjects AdvNhaCungCap
        {
            [DebuggerNonUserCode]
            get
            {
                return this._AdvNhaCungCap;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                ADVObjects.ValueChangedEventHandler handler = new ADVObjects.ValueChangedEventHandler(this.AdvNhaCungCap_ValueChanged);
                if (this._AdvNhaCungCap != null)
                {
                    this._AdvNhaCungCap.ValueChanged -= handler;
                }
                this._AdvNhaCungCap = value;
                if (this._AdvNhaCungCap != null)
                {
                    this._AdvNhaCungCap.ValueChanged += handler;
                }
            }
        }

        internal virtual ADVObjects AdvNhanVien
        {
            [DebuggerNonUserCode]
            get
            {
                return this._AdvNhanVien;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._AdvNhanVien = value;
            }
        }

        internal virtual ToolStripComboBox CboLanguage
        {
            [DebuggerNonUserCode]
            get
            {
                return this._CboLanguage;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._CboLanguage = value;
            }
        }

        internal virtual ComboBox CboLienHe
        {
            [DebuggerNonUserCode]
            get
            {
                return this._CboLienHe;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                KeyEventHandler handler = new KeyEventHandler(this.Frm_KeyDown);
                if (this._CboLienHe != null)
                {
                    this._CboLienHe.KeyDown -= handler;
                }
                this._CboLienHe = value;
                if (this._CboLienHe != null)
                {
                    this._CboLienHe.KeyDown += handler;
                }
            }
        }

        internal virtual ComboBox CboLoaiTien
        {
            [DebuggerNonUserCode]
            get
            {
                return this._CboLoaiTien;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                EventHandler handler = new EventHandler(this.CboLoaiTien_SelectedIndexChanged);
                KeyEventHandler handler2 = new KeyEventHandler(this.Frm_KeyDown);
                if (this._CboLoaiTien != null)
                {
                    this._CboLoaiTien.SelectedIndexChanged -= handler;
                    this._CboLoaiTien.KeyDown -= handler2;
                }
                this._CboLoaiTien = value;
                if (this._CboLoaiTien != null)
                {
                    this._CboLoaiTien.SelectedIndexChanged += handler;
                    this._CboLoaiTien.KeyDown += handler2;
                }
            }
        }

        internal virtual ComboBox CboPhuongThucThanhToan
        {
            [DebuggerNonUserCode]
            get
            {
                return this._CboPhuongThucThanhToan;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                KeyEventHandler handler = new KeyEventHandler(this.Frm_KeyDown);
                if (this._CboPhuongThucThanhToan != null)
                {
                    this._CboPhuongThucThanhToan.KeyDown -= handler;
                }
                this._CboPhuongThucThanhToan = value;
                if (this._CboPhuongThucThanhToan != null)
                {
                    this._CboPhuongThucThanhToan.KeyDown += handler;
                }
            }
        }

        internal virtual ComboBox CboPhuongThucVanChuyen
        {
            [DebuggerNonUserCode]
            get
            {
                return this._CboPhuongThucVanChuyen;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                KeyEventHandler handler = new KeyEventHandler(this.Frm_KeyDown);
                if (this._CboPhuongThucVanChuyen != null)
                {
                    this._CboPhuongThucVanChuyen.KeyDown -= handler;
                }
                this._CboPhuongThucVanChuyen = value;
                if (this._CboPhuongThucVanChuyen != null)
                {
                    this._CboPhuongThucVanChuyen.KeyDown += handler;
                }
            }
        }

        internal virtual ComboBox CboTinhTrang
        {
            [DebuggerNonUserCode]
            get
            {
                return this._CboTinhTrang;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._CboTinhTrang = value;
            }
        }

        internal virtual ToolStripButton CmdAdd
        {
            [DebuggerNonUserCode]
            get
            {
                return this._CmdAdd;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                EventHandler handler = new EventHandler(this.CmdAdd_Click);
                if (this._CmdAdd != null)
                {
                    this._CmdAdd.Click -= handler;
                }
                this._CmdAdd = value;
                if (this._CmdAdd != null)
                {
                    this._CmdAdd.Click += handler;
                }
            }
        }

        internal virtual Button CmdAddRow
        {
            [DebuggerNonUserCode]
            get
            {
                return this._CmdAddRow;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                EventHandler handler = new EventHandler(this.CmdAddRow_Click);
                if (this._CmdAddRow != null)
                {
                    this._CmdAddRow.Click -= handler;
                }
                this._CmdAddRow = value;
                if (this._CmdAddRow != null)
                {
                    this._CmdAddRow.Click += handler;
                }
            }
        }

        internal virtual ToolStripButton CmdDel
        {
            [DebuggerNonUserCode]
            get
            {
                return this._CmdDel;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                EventHandler handler = new EventHandler(this.CmdDel_Click);
                if (this._CmdDel != null)
                {
                    this._CmdDel.Click -= handler;
                }
                this._CmdDel = value;
                if (this._CmdDel != null)
                {
                    this._CmdDel.Click += handler;
                }
            }
        }

        internal virtual Button CmdDelRow
        {
            [DebuggerNonUserCode]
            get
            {
                return this._CmdDelRow;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                EventHandler handler = new EventHandler(this.CmdDelRow_Click);
                if (this._CmdDelRow != null)
                {
                    this._CmdDelRow.Click -= handler;
                }
                this._CmdDelRow = value;
                if (this._CmdDelRow != null)
                {
                    this._CmdDelRow.Click += handler;
                }
            }
        }

        internal virtual ToolStripButton CmdEdit
        {
            [DebuggerNonUserCode]
            get
            {
                return this._CmdEdit;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                EventHandler handler = new EventHandler(this.CmdEdit_Click);
                if (this._CmdEdit != null)
                {
                    this._CmdEdit.Click -= handler;
                }
                this._CmdEdit = value;
                if (this._CmdEdit != null)
                {
                    this._CmdEdit.Click += handler;
                }
            }
        }

        internal virtual ToolStripButton CmdExit
        {
            [DebuggerNonUserCode]
            get
            {
                return this._CmdExit;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                EventHandler handler = new EventHandler(this.CmdExit_Click);
                if (this._CmdExit != null)
                {
                    this._CmdExit.Click -= handler;
                }
                this._CmdExit = value;
                if (this._CmdExit != null)
                {
                    this._CmdExit.Click += handler;
                }
            }
        }

        internal virtual ToolStripButton CmdFind
        {
            [DebuggerNonUserCode]
            get
            {
                return this._CmdFind;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                EventHandler handler = new EventHandler(this.CmdFind_Click);
                if (this._CmdFind != null)
                {
                    this._CmdFind.Click -= handler;
                }
                this._CmdFind = value;
                if (this._CmdFind != null)
                {
                    this._CmdFind.Click += handler;
                }
            }
        }

        internal virtual ToolStripButton CmdHelp
        {
            [DebuggerNonUserCode]
            get
            {
                return this._CmdHelp;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._CmdHelp = value;
            }
        }

        internal virtual ToolStripMenuItem CmdInTiengAnh
        {
            [DebuggerNonUserCode]
            get
            {
                return this._CmdInTiengAnh;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                EventHandler handler = new EventHandler(this.CmdInTiengAnh_Click);
                if (this._CmdInTiengAnh != null)
                {
                    this._CmdInTiengAnh.Click -= handler;
                }
                this._CmdInTiengAnh = value;
                if (this._CmdInTiengAnh != null)
                {
                    this._CmdInTiengAnh.Click += handler;
                }
            }
        }

        internal virtual ToolStripMenuItem CmdInTiengViet
        {
            [DebuggerNonUserCode]
            get
            {
                return this._CmdInTiengViet;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                EventHandler handler = new EventHandler(this.CmdInTiengViet_Click);
                if (this._CmdInTiengViet != null)
                {
                    this._CmdInTiengViet.Click -= handler;
                }
                this._CmdInTiengViet = value;
                if (this._CmdInTiengViet != null)
                {
                    this._CmdInTiengViet.Click += handler;
                }
            }
        }

        internal virtual ToolStripDropDownButton CmdPrint
        {
            [DebuggerNonUserCode]
            get
            {
                return this._CmdPrint;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                EventHandler handler = new EventHandler(this.CmdPrint_Click);
                if (this._CmdPrint != null)
                {
                    this._CmdPrint.Click -= handler;
                }
                this._CmdPrint = value;
                if (this._CmdPrint != null)
                {
                    this._CmdPrint.Click += handler;
                }
            }
        }

        internal virtual ToolStripButton CmdSave
        {
            [DebuggerNonUserCode]
            get
            {
                return this._CmdSave;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                EventHandler handler = new EventHandler(this.CmdSave_Click);
                if (this._CmdSave != null)
                {
                    this._CmdSave.Click -= handler;
                }
                this._CmdSave = value;
                if (this._CmdSave != null)
                {
                    this._CmdSave.Click += handler;
                }
            }
        }

        internal virtual ToolStripButton CmdUnsave
        {
            [DebuggerNonUserCode]
            get
            {
                return this._CmdUnsave;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                EventHandler handler = new EventHandler(this.CmdUnsave_Click);
                if (this._CmdUnsave != null)
                {
                    this._CmdUnsave.Click -= handler;
                }
                this._CmdUnsave = value;
                if (this._CmdUnsave != null)
                {
                    this._CmdUnsave.Click += handler;
                }
            }
        }

        internal virtual ToolStripButton CmdXacNhan
        {
            [DebuggerNonUserCode]
            get
            {
                return this._CmdXacNhan;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                EventHandler handler = new EventHandler(this.CmdXacNhan_Click);
                if (this._CmdXacNhan != null)
                {
                    this._CmdXacNhan.Click -= handler;
                }
                this._CmdXacNhan = value;
                if (this._CmdXacNhan != null)
                {
                    this._CmdXacNhan.Click += handler;
                }
            }
        }

        public bool EnabledControl
        {
            get
            {
                return this.mEnabledControl;
            }
            set
            {
                this.mEnabledControl = value;
                this.CmdAdd.Enabled = !value & this.mAllowAdd;
                this.CmdEdit.Enabled = !value & this.mAllowEdit;
                this.CmdSave.Enabled = value;
                this.CmdUnsave.Enabled = value;
                this.CmdDel.Enabled = !value & this.mAllowDel;
                this.CmdFind.Enabled = !value;
                this.CmdExit.Enabled = !value;
                this.CmdAddRow.Enabled = value;
                this.CmdDelRow.Enabled = value;
                this.CmdPrint.Enabled = !value;
                this.TxtSoChungTu.ReadOnly = !value;
                this.TxtNgayChungTu.Enabled = value;
                this.CboLoaiTien.Enabled = value;
                this.txtTyGia.ReadOnly = !value;
                this.TxtDienGiai.ReadOnly = !value;
                this.TxtSoChungTu.ReadOnly = !value;
                this.AdvNhaCungCap.ReadOnly = !value;
                this.TxtDiaChiNhaCungCap.ReadOnly = !value;
                this.CboLienHe.Enabled = value;
                this.CboPhuongThucVanChuyen.Enabled = value;
                this.CboPhuongThucThanhToan.Enabled = value;
                this.TxtDiaChiGiaoHang.ReadOnly = !value;
                this.TxtDienGiai.ReadOnly = !value;
                this.TxtHanGiaoHang.Enabled = value;
                this.TxtSoHopDong.ReadOnly = !value;
                this.AdvNhanVien.ReadOnly = !value;
                this.TxtCongThemNT.ReadOnly = !value;
                this.CboTinhTrang.Enabled = value;
            }
        }

        internal virtual Label Label1
        {
            [DebuggerNonUserCode]
            get
            {
                return this._Label1;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._Label1 = value;
            }
        }

        internal virtual Label Label10
        {
            [DebuggerNonUserCode]
            get
            {
                return this._Label10;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._Label10 = value;
            }
        }

        internal virtual Label Label11
        {
            [DebuggerNonUserCode]
            get
            {
                return this._Label11;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._Label11 = value;
            }
        }

        internal virtual Label Label12
        {
            [DebuggerNonUserCode]
            get
            {
                return this._Label12;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._Label12 = value;
            }
        }

        internal virtual Label Label13
        {
            [DebuggerNonUserCode]
            get
            {
                return this._Label13;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._Label13 = value;
            }
        }

        internal virtual Label Label14
        {
            [DebuggerNonUserCode]
            get
            {
                return this._Label14;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._Label14 = value;
            }
        }

        internal virtual Label Label15
        {
            [DebuggerNonUserCode]
            get
            {
                return this._Label15;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._Label15 = value;
            }
        }

        internal virtual Label Label16
        {
            [DebuggerNonUserCode]
            get
            {
                return this._Label16;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._Label16 = value;
            }
        }

        internal virtual Label Label17
        {
            [DebuggerNonUserCode]
            get
            {
                return this._Label17;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._Label17 = value;
            }
        }

        internal virtual Label Label18
        {
            [DebuggerNonUserCode]
            get
            {
                return this._Label18;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._Label18 = value;
            }
        }

        internal virtual Label Label19
        {
            [DebuggerNonUserCode]
            get
            {
                return this._Label19;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._Label19 = value;
            }
        }

        internal virtual Label Label2
        {
            [DebuggerNonUserCode]
            get
            {
                return this._Label2;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._Label2 = value;
            }
        }

        internal virtual Label Label3
        {
            [DebuggerNonUserCode]
            get
            {
                return this._Label3;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._Label3 = value;
            }
        }

        internal virtual Label Label4
        {
            [DebuggerNonUserCode]
            get
            {
                return this._Label4;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._Label4 = value;
            }
        }

        internal virtual Label Label5
        {
            [DebuggerNonUserCode]
            get
            {
                return this._Label5;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._Label5 = value;
            }
        }

        internal virtual Label Label6
        {
            [DebuggerNonUserCode]
            get
            {
                return this._Label6;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._Label6 = value;
            }
        }

        internal virtual Label Label7
        {
            [DebuggerNonUserCode]
            get
            {
                return this._Label7;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._Label7 = value;
            }
        }

        internal virtual Label Label8
        {
            [DebuggerNonUserCode]
            get
            {
                return this._Label8;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._Label8 = value;
            }
        }

        internal virtual Label Label9
        {
            [DebuggerNonUserCode]
            get
            {
                return this._Label9;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._Label9 = value;
            }
        }

        internal virtual Panel Panel4
        {
            [DebuggerNonUserCode]
            get
            {
                return this._Panel4;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._Panel4 = value;
            }
        }

        internal virtual Panel Panel5
        {
            [DebuggerNonUserCode]
            get
            {
                return this._Panel5;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._Panel5 = value;
            }
        }

        internal virtual TabControl TabControl1
        {
            [DebuggerNonUserCode]
            get
            {
                return this._TabControl1;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._TabControl1 = value;
            }
        }

        internal virtual TabControl TabDetails
        {
            [DebuggerNonUserCode]
            get
            {
                return this._TabDetails;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._TabDetails = value;
            }
        }

        internal virtual TabPage TabPage1
        {
            [DebuggerNonUserCode]
            get
            {
                return this._TabPage1;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._TabPage1 = value;
            }
        }

        internal virtual TabPage TabPage4
        {
            [DebuggerNonUserCode]
            get
            {
                return this._TabPage4;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._TabPage4 = value;
            }
        }

        internal virtual ToolStrip ToolStrip1
        {
            [DebuggerNonUserCode]
            get
            {
                return this._ToolStrip1;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._ToolStrip1 = value;
            }
        }

        internal virtual ToolStripSeparator ToolStripButton1
        {
            [DebuggerNonUserCode]
            get
            {
                return this._ToolStripButton1;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._ToolStripButton1 = value;
            }
        }

        internal virtual ToolStripSeparator ToolStripSeparator1
        {
            [DebuggerNonUserCode]
            get
            {
                return this._ToolStripSeparator1;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._ToolStripSeparator1 = value;
            }
        }

        internal virtual ToolStripSeparator ToolStripSeparator2
        {
            [DebuggerNonUserCode]
            get
            {
                return this._ToolStripSeparator2;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._ToolStripSeparator2 = value;
            }
        }

        internal virtual ToolStripSeparator ToolStripSeparator3
        {
            [DebuggerNonUserCode]
            get
            {
                return this._ToolStripSeparator3;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._ToolStripSeparator3 = value;
            }
        }

        internal virtual C1NumericEdit TxtCongThem
        {
            [DebuggerNonUserCode]
            get
            {
                return this._TxtCongThem;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                KeyEventHandler handler = new KeyEventHandler(this.Frm_KeyDown);
                if (this._TxtCongThem != null)
                {
                    this._TxtCongThem.KeyDown -= handler;
                }
                this._TxtCongThem = value;
                if (this._TxtCongThem != null)
                {
                    this._TxtCongThem.KeyDown += handler;
                }
            }
        }

        internal virtual C1NumericEdit TxtCongThemNT
        {
            [DebuggerNonUserCode]
            get
            {
                return this._TxtCongThemNT;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                EventHandler handler = new EventHandler(this.TxtCongThemNT_LostFocus);
                KeyEventHandler handler2 = new KeyEventHandler(this.Frm_KeyDown);
                if (this._TxtCongThemNT != null)
                {
                    this._TxtCongThemNT.LostFocus -= handler;
                    this._TxtCongThemNT.KeyDown -= handler2;
                }
                this._TxtCongThemNT = value;
                if (this._TxtCongThemNT != null)
                {
                    this._TxtCongThemNT.LostFocus += handler;
                    this._TxtCongThemNT.KeyDown += handler2;
                }
            }
        }

        internal virtual TextBox TxtDiaChiGiaoHang
        {
            [DebuggerNonUserCode]
            get
            {
                return this._TxtDiaChiGiaoHang;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._TxtDiaChiGiaoHang = value;
            }
        }

        internal virtual TextBox TxtDiaChiNhaCungCap
        {
            [DebuggerNonUserCode]
            get
            {
                return this._TxtDiaChiNhaCungCap;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                KeyEventHandler handler = new KeyEventHandler(this.Frm_KeyDown);
                if (this._TxtDiaChiNhaCungCap != null)
                {
                    this._TxtDiaChiNhaCungCap.KeyDown -= handler;
                }
                this._TxtDiaChiNhaCungCap = value;
                if (this._TxtDiaChiNhaCungCap != null)
                {
                    this._TxtDiaChiNhaCungCap.KeyDown += handler;
                }
            }
        }

        internal virtual TextBox TxtDienGiai
        {
            [DebuggerNonUserCode]
            get
            {
                return this._TxtDienGiai;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._TxtDienGiai = value;
            }
        }

        internal virtual DateTimePicker TxtHanGiaoHang
        {
            [DebuggerNonUserCode]
            get
            {
                return this._TxtHanGiaoHang;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                KeyEventHandler handler = new KeyEventHandler(this.Frm_KeyDown);
                if (this._TxtHanGiaoHang != null)
                {
                    this._TxtHanGiaoHang.KeyDown -= handler;
                }
                this._TxtHanGiaoHang = value;
                if (this._TxtHanGiaoHang != null)
                {
                    this._TxtHanGiaoHang.KeyDown += handler;
                }
            }
        }

        internal virtual DateTimePicker TxtNgayChungTu
        {
            [DebuggerNonUserCode]
            get
            {
                return this._TxtNgayChungTu;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                KeyEventHandler handler = new KeyEventHandler(this.Frm_KeyDown);
                if (this._TxtNgayChungTu != null)
                {
                    this._TxtNgayChungTu.KeyDown -= handler;
                }
                this._TxtNgayChungTu = value;
                if (this._TxtNgayChungTu != null)
                {
                    this._TxtNgayChungTu.KeyDown += handler;
                }
            }
        }

        internal virtual TextBox TxtSoChungTu
        {
            [DebuggerNonUserCode]
            get
            {
                return this._TxtSoChungTu;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                KeyEventHandler handler = new KeyEventHandler(this.Frm_KeyDown);
                if (this._TxtSoChungTu != null)
                {
                    this._TxtSoChungTu.KeyDown -= handler;
                }
                this._TxtSoChungTu = value;
                if (this._TxtSoChungTu != null)
                {
                    this._TxtSoChungTu.KeyDown += handler;
                }
            }
        }

        internal virtual TextBox TxtSoHopDong
        {
            [DebuggerNonUserCode]
            get
            {
                return this._TxtSoHopDong;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                KeyEventHandler handler = new KeyEventHandler(this.Frm_KeyDown);
                if (this._TxtSoHopDong != null)
                {
                    this._TxtSoHopDong.KeyDown -= handler;
                }
                this._TxtSoHopDong = value;
                if (this._TxtSoHopDong != null)
                {
                    this._TxtSoHopDong.KeyDown += handler;
                }
            }
        }

        internal virtual C1NumericEdit TxtSoTien
        {
            [DebuggerNonUserCode]
            get
            {
                return this._TxtSoTien;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._TxtSoTien = value;
            }
        }

        internal virtual C1NumericEdit TxtSoTienNT
        {
            [DebuggerNonUserCode]
            get
            {
                return this._TxtSoTienNT;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._TxtSoTienNT = value;
            }
        }

        internal virtual C1NumericEdit TxtTienThue
        {
            [DebuggerNonUserCode]
            get
            {
                return this._TxtTienThue;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._TxtTienThue = value;
            }
        }

        internal virtual C1NumericEdit TxtTienThueNT
        {
            [DebuggerNonUserCode]
            get
            {
                return this._TxtTienThueNT;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._TxtTienThueNT = value;
            }
        }

        internal virtual C1NumericEdit TxtTongCong
        {
            [DebuggerNonUserCode]
            get
            {
                return this._TxtTongCong;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._TxtTongCong = value;
            }
        }

        internal virtual C1NumericEdit TxtTongCongNT
        {
            [DebuggerNonUserCode]
            get
            {
                return this._TxtTongCongNT;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._TxtTongCongNT = value;
            }
        }

        internal virtual C1NumericEdit txtTyGia
        {
            [DebuggerNonUserCode]
            get
            {
                return this._txtTyGia;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                KeyEventHandler handler = new KeyEventHandler(this.Frm_KeyDown);
                if (this._txtTyGia != null)
                {
                    this._txtTyGia.KeyDown -= handler;
                }
                this._txtTyGia = value;
                if (this._txtTyGia != null)
                {
                    this._txtTyGia.KeyDown += handler;
                }
            }
        }

        internal virtual C1.Win.C1FlexGrid.C1FlexGrid VSlist
        {
            [DebuggerNonUserCode]
            get
            {
                return this._VSlist;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                RowColEventHandler handler = new RowColEventHandler(this.VSlist_AfterEdit);
                RowColEventHandler handler2 = new RowColEventHandler(this.VSlist_CellButtonClick);
                RowColEventHandler handler3 = new RowColEventHandler(this.VSlist_BeforeEdit);
                if (this._VSlist != null)
                {
                    this._VSlist.AfterEdit -= handler;
                    this._VSlist.CellButtonClick -= handler2;
                    this._VSlist.BeforeEdit -= handler3;
                }
                this._VSlist = value;
                if (this._VSlist != null)
                {
                    this._VSlist.AfterEdit += handler;
                    this._VSlist.CellButtonClick += handler2;
                    this._VSlist.BeforeEdit += handler3;
                }
            }
        }
    }
}

